﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using YArchitech.Controls;
using YArchitech.Controls.HeaderGridView;
using YArchitech.DataModel;
using YArchitech.LIB;
using YArchitech.LIB.YJKControls;
using YArchitech.Plumbing.Properties;

namespace YArchitech.Plumbing
{
	public partial class FormPumpSel : System.Windows.Forms.Form
	{
		public FormPumpSel()
		{
			this.InitializeComponent();
			base.Icon = Resource.YArchitechIcon;
			this.singlePumpSel = new SinglePumpSelection();
			this.groupPumpSel = new GroupPumpSelection();
			this.m_allPumps = HYPumpDataManager.GetAllPumpData();
		}

		private void FormPumpSel_Load(object sender, EventArgs e)
		{
			this.InitPumpSelSinglePage();
			this.InitPumpSelGrid();
			this.InitPumpsDataGrid();
			this.InitializeComboBox();
			this.InitCmbUnity();
			this.rbSRangeMatch.Checked = true;
			this.InitPumpSelGroupPage();
			this.InitializegComboBox();
			this.InitPumpGroupWorkGrid();
			this.InitGroupPumpList();
			this.btngReName.Image = YArchitech.LIB.Resources.modify16;
			this.InitCmbUnityg();
			this.rbGRangeMatch.Checked = false;
			this.rbGPiancha.Checked = true;
			this.rbGPumpsB.Checked = true;
			this.checkBoxPoint.Checked = true;
			this.checkBoxTitle.Checked = true;
			this.InitPumpResultTreeview();
			this.InitComboBoxLine();
			this.hyPumpGraphChart.InitSeries();
			this.UpDateUIData();
		}

		private string[] GetAllFactory()
		{
			List<string> list = new List<string>();
			list.Add("全部");
			foreach (HYPumpFactory hypumpFactory in HYPumpDataManager.GetAllFactory())
			{
				if (!list.Contains(hypumpFactory.szFactory))
				{
					list.Add(hypumpFactory.szFactory);
				}
			}
			return list.ToArray();
		}

		private HYPumpData GetHYpumpBySPEC(string sSPEC)
		{
			foreach (HYPumpData hypumpData in this.m_allPumps)
			{
				if (sSPEC == hypumpData.StrSpecification)
				{
					return hypumpData;
				}
			}
			return null;
		}

		private void addDataRow(ref DataTable dt, object item, object value)
		{
			DataRow dataRow = dt.NewRow();
			dataRow[0] = item;
			dataRow[1] = value;
			dt.Rows.Add(dataRow);
		}

		private void BindComboBox(ComboBox cmb, List<string> names)
		{
			DataTable dataTable = new DataTable();
			dataTable.Columns.Add("Value");
			dataTable.Columns.Add("Name");
			for (int i = 0; i < names.Count; i++)
			{
				DataRow dataRow = dataTable.NewRow();
				dataRow[0] = i;
				dataRow[1] = names[i];
				dataTable.Rows.Add(dataRow);
			}
			cmb.ValueMember = "Value";
			cmb.DisplayMember = "Name";
			cmb.DataSource = dataTable;
			cmb.DropDownStyle = ComboBoxStyle.DropDownList;
		}

		private void SetDataGridvViewRowsVisiable(DataGridView dgv, int rowIndex, bool bVisiable)
		{
			try
			{
				CurrencyManager currencyManager = (CurrencyManager)this.BindingContext[dgv.DataSource];
				currencyManager.SuspendBinding();
				dgv.Rows[rowIndex].Visible = bVisiable;
				currencyManager.ResumeBinding();
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void SetDataGridvViewRowsVisiable(DataGridView dgv, int[] rowIndexs, bool bVisiable)
		{
			try
			{
				CurrencyManager currencyManager = (CurrencyManager)this.BindingContext[dgv.DataSource];
				currencyManager.SuspendBinding();
				foreach (int index in rowIndexs)
				{
					dgv.Rows[index].Visible = bVisiable;
				}
				currencyManager.ResumeBinding();
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void PumpSelPage_SelectedIndexChanged(object sender, EventArgs e)
		{
			int selectedIndex = this.PumpSelPage.SelectedIndex;
			if (selectedIndex <= 1)
			{
				this.btnSave.Enabled = false;
				this.btnExport.Enabled = false;
				this.btnImport.Enabled = false;
				this.btnAddToList.Visible = true;
				this.GroupDeal();
				return;
			}
			if (selectedIndex != 2)
			{
				return;
			}
			this.btnSave.Enabled = true;
			this.btnExport.Enabled = true;
			this.btnImport.Enabled = true;
			this.btnAddToList.Visible = false;
		}

		private void GroupDeal()
		{
			bool @checked = this.rbGRangeMatch.Checked;
			this.rbGPiancha.Checked = !@checked;
			this.rbGRangeMatch.Checked = @checked;
			this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 5, false);
		}

		private string ChangePumpHUnionty(ref double dH, string sHtext, int oldIndex, int newIndex)
		{
			if (oldIndex == newIndex)
			{
				return sHtext;
			}
			dH = ((Math.Abs(dH - double.Parse(sHtext)) > 0.001) ? double.Parse(sHtext) : dH);
			if (oldIndex == 0)
			{
				dH *= 0.00980661;
			}
			else
			{
				dH *= 101.972;
			}
			return dH.ToString("#0.000");
		}

		private string ChangePumpQUnionty(ref double dQ, string sQtext, int oldIndex, int newIndex)
		{
			if (oldIndex == newIndex)
			{
				return sQtext;
			}
			dQ = ((Math.Abs(dQ - double.Parse(sQtext)) > 1E-06) ? double.Parse(sQtext) : dQ);
			switch (oldIndex)
			{
			case 0:
				if (newIndex == 1)
				{
					dQ /= 3600.0;
				}
				else if (newIndex == 2)
				{
					dQ /= 3.6;
				}
				break;
			case 1:
				if (newIndex == 0)
				{
					dQ *= 3600.0;
				}
				else if (newIndex == 2)
				{
					dQ *= 1000.0;
				}
				break;
			case 2:
				if (newIndex == 0)
				{
					dQ *= 3.6;
				}
				else if (newIndex == 1)
				{
					dQ /= 1000.0;
				}
				break;
			}
			return dQ.ToString("#0.000000");
		}

		private void InitCmbUnity()
		{
			this.hyTbSPumpH.Tag = 0;
			this.hyTbSPumpMaxH.Tag = 0;
			this.cmbpumpHunity.Items.Clear();
			this.cmbpumpHunity.Items.Add("m");
			this.cmbpumpHunity.Items.Add("MPa");
			this.cmbpumpHunity.SelectedIndex = 0;
			this.hyTbSPumpQ.Tag = 0;
			this.hyTbSPumpMaxQ.Tag = 0;
			this.cmbpumpQunity.Items.Clear();
			this.cmbpumpQunity.Items.Add("m3/h");
			this.cmbpumpQunity.Items.Add("m3/s");
			this.cmbpumpQunity.Items.Add("L/s");
			this.cmbpumpQunity.SelectedIndex = 0;
		}

		private void InitPumpSelSinglePage()
		{
			this.cmbSFactory.Items.AddRange(this.GetAllFactory());
			this.cmbSPumpType.Items.AddRange(this.strPumpJGLeiLeiXing);
			this.cmbSStructType.Items.Add("全部");
			this.cmbSInstallType.Items.AddRange(this.strPumpInstallType);
			this.cmbSLunzhouPos.Items.Add("全部");
			this.cmbSUse.Items.AddRange(this.strPumpUse);
			foreach (object obj in this.gbSLimitBase.Controls)
			{
				if (obj is CheckBox)
				{
					(obj as CheckBox).Checked = true;
				}
				else if (obj is ComboBox)
				{
					(obj as ComboBox).SelectedIndex = 0;
				}
			}
		}

		private List<string> GetPumpStructData(string strPumpType)
		{
			List<string> list = new List<string>();
			if (!(strPumpType == "全部"))
			{
				if (!(strPumpType == "离心式"))
				{
					if (!(strPumpType == "轴流式"))
					{
						if (strPumpType == "混流式")
						{
							list = this.strPumpHunLiu.ToList<string>();
						}
					}
					else
					{
						list = this.strPumpZhouLiu.ToList<string>();
					}
				}
				else
				{
					list = this.strPumpLiXin.ToList<string>();
				}
			}
			else
			{
				list.Add("全部");
			}
			return list;
		}

		private void InitializeComboBox()
		{
			this.cmb_sPipeOpen = new ComboBox();
			string[] source = new string[]
			{
				"闭式",
				"开式"
			};
			this.BindComboBox(this.cmb_sPipeOpen, source.ToList<string>());
			this.cmb_sPipeOpen.Name = "PipeOpen";
			this.cmb_sPipeOpen.SelectedIndexChanged += this.defcmb_SelectedIndexChanged;
			this.cmb_sDrawAbility = new ComboBox();
			string[] source2 = new string[]
			{
				"不校核",
				"校核"
			};
			this.BindComboBox(this.cmb_sDrawAbility, source2.ToList<string>());
			this.cmb_sDrawAbility.Name = "DrawAbility";
			this.cmb_sDrawAbility.SelectedIndexChanged += this.defcmb_SelectedIndexChanged;
			this.cmb_sTempLimit = new ComboBox();
			string[] source3 = new string[]
			{
				"不限制",
				"限制"
			};
			this.BindComboBox(this.cmb_sTempLimit, source3.ToList<string>());
			this.cmb_sTempLimit.Name = "TempLimit";
			this.cmb_sTempLimit.SelectedIndexChanged += this.defcmb_SelectedIndexChanged;
			this.cmb_gGroupNum = new ComboBox();
			string[] source4 = new string[]
			{
				"自动确定",
				"手动设定"
			};
			this.BindComboBox(this.cmb_gGroupNum, source4.ToList<string>());
			this.cmb_gGroupNum.Name = "GroupNum";
			this.dgvSWorkParas.Controls.Add(this.cmb_sPipeOpen);
			this.dgvSWorkParas.Controls.Add(this.cmb_sDrawAbility);
			this.dgvSWorkParas.Controls.Add(this.cmb_sTempLimit);
			this.cmb_sPipeOpen.Visible = false;
			this.cmb_sDrawAbility.Visible = false;
			this.cmb_sTempLimit.Visible = false;
		}

		private void InitPumpSelGrid()
		{
			this.bInitGrig = false;
			DataTable dataTable = new DataTable();
			dataTable.Columns.Add("Item");
			dataTable.Columns.Add("Value");
			this.addDataRow(ref dataTable, "偏差度", "");
			this.addDataRow(ref dataTable, "扬程最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "流量最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "效率最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "工况", "");
			this.addDataRow(ref dataTable, "流体类型", "清水");
			this.addDataRow(ref dataTable, "工作温度(℃)", 20.0);
			this.addDataRow(ref dataTable, "管路", 1);
			this.addDataRow(ref dataTable, "静扬程", 0.0);
			this.addDataRow(ref dataTable, "工况限制", "");
			this.addDataRow(ref dataTable, "吸水性能校核", 0);
			this.addDataRow(ref dataTable, "当地大气压(MPa)", 0.101325);
			this.addDataRow(ref dataTable, "吸水管路损失(mH2O)", 0.0);
			this.addDataRow(ref dataTable, "安装高度(m)", 0.0);
			this.addDataRow(ref dataTable, "安全系数", 1.1);
			this.addDataRow(ref dataTable, "最大承压(m)", 0.0);
			this.addDataRow(ref dataTable, "流体温度限制", 0);
			this.addDataRow(ref dataTable, "上限温度(℃)", 80.0);
			this.addDataRow(ref dataTable, "下限温度(℃)", 0.0);
			this.dgvSWorkParas.DataSource = dataTable;
			this.bInitGrig = true;
		}

		private void dgvSWorkParas_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
		{
			if (e.RowIndex == 0 || e.RowIndex == 4 || e.RowIndex == 9)
			{
				using (Brush brush = new SolidBrush(this.dgvSWorkParas.GridColor))
				{
					using (Brush brush2 = new SolidBrush(e.CellStyle.BackColor))
					{
						using (Pen pen = new Pen(brush))
						{
							e.Graphics.FillRectangle(brush2, e.CellBounds);
							e.Graphics.DrawLine(pen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
							if (e.Value != null && e.ColumnIndex <= 0)
							{
								e.Graphics.DrawString((string)e.Value, new Font("黑体", 11f, FontStyle.Bold), Brushes.Black, (float)(e.CellBounds.X + 2), (float)(e.CellBounds.Y + 5), StringFormat.GenericDefault);
							}
							e.Handled = true;
						}
					}
				}
				e.CellStyle.BackColor = Color.YellowGreen;
				e.CellStyle.ForeColor = Color.Black;
			}
		}

		private void InitPumpsDataGrid()
		{
			object[] values = new object[]
			{
				"自动选型列表"
			};
			object[] values2 = new object[]
			{
				"手动选型列表"
			};
			this.dgvSinglePumpResult.Rows.Add(values);
			this.dgvSinglePumpResult.Rows.Add(values2);
			this.cellAuto = (this.dgvSinglePumpResult.Rows[0].Cells[0] as DataGridViewGroupCell);
			this.cellMan = (this.dgvSinglePumpResult.Rows[1].Cells[0] as DataGridViewGroupCell);
		}

		private void InitCmbUnityg()
		{
			this.hytbGPumpH.Tag = 0;
			this.hytbGPumpMaxH.Tag = 0;
			this.cmbgPumpH.Items.Clear();
			this.cmbgPumpH.Items.Add("m");
			this.cmbgPumpH.Items.Add("MPa");
			this.cmbgPumpH.SelectedIndex = 0;
			this.hytbGPumpQ.Tag = 0;
			this.hytbGPumpMaxQ.Tag = 0;
			this.cmbgpumpQ.Items.Clear();
			this.cmbgpumpQ.Items.Add("m3/h");
			this.cmbgpumpQ.Items.Add("m3/s");
			this.cmbgpumpQ.Items.Add("L/s");
			this.cmbgpumpQ.SelectedIndex = 0;
		}

		private void InitializegComboBox()
		{
			this.cmb_gPipeOpen = new ComboBox();
			string[] source = new string[]
			{
				"闭式",
				"开式"
			};
			this.BindComboBox(this.cmb_gPipeOpen, source.ToList<string>());
			this.cmb_gPipeOpen.Name = "PipeOpen";
			this.cmb_gPipeOpen.SelectedIndexChanged += this.defgcmb_SelectedIndexChanged;
			this.cmb_gDrawAbility = new ComboBox();
			string[] source2 = new string[]
			{
				"不校核",
				"校核"
			};
			this.BindComboBox(this.cmb_gDrawAbility, source2.ToList<string>());
			this.cmb_gDrawAbility.Name = "DrawAbility";
			this.cmb_gDrawAbility.SelectedIndexChanged += this.defgcmb_SelectedIndexChanged;
			this.cmb_gTempLimit = new ComboBox();
			string[] source3 = new string[]
			{
				"不限制",
				"限制"
			};
			this.BindComboBox(this.cmb_gTempLimit, source3.ToList<string>());
			this.cmb_gTempLimit.Name = "TempLimit";
			this.cmb_gTempLimit.SelectedIndexChanged += this.defgcmb_SelectedIndexChanged;
			this.cmb_gGroupNum = new ComboBox();
			string[] source4 = new string[]
			{
				"自动确定",
				"手动指定"
			};
			this.BindComboBox(this.cmb_gGroupNum, source4.ToList<string>());
			this.cmb_gGroupNum.Name = "GroupNum";
			this.cmb_gGroupNum.SelectedIndexChanged += this.defgcmb_SelectedIndexChanged;
			this.dgvGWorkParas.Controls.Add(this.cmb_gPipeOpen);
			this.dgvGWorkParas.Controls.Add(this.cmb_gDrawAbility);
			this.dgvGWorkParas.Controls.Add(this.cmb_gTempLimit);
			this.dgvGWorkParas.Controls.Add(this.cmb_gGroupNum);
			this.cmb_gPipeOpen.Visible = false;
			this.cmb_gDrawAbility.Visible = false;
			this.cmb_gTempLimit.Visible = false;
			this.cmb_gGroupNum.Visible = false;
		}

		private void InitPumpSelGroupPage()
		{
			this.cmbGFactory.Items.AddRange(this.GetAllFactory());
			this.cmbGPumpType.Items.AddRange(this.strPumpJGLeiLeiXing);
			this.cmbGStructType.Items.Add("全部");
			this.cmbGInstallType.Items.AddRange(this.strPumpInstallType);
			this.cmbGLunZhouPos.Items.Add("全部");
			this.cmbGUse.Items.AddRange(this.strPumpUse);
			foreach (object obj in this.gbGLimitBase.Controls)
			{
				if (obj is CheckBox)
				{
					(obj as CheckBox).Checked = true;
				}
				else if (obj is ComboBox)
				{
					(obj as ComboBox).SelectedIndex = 0;
				}
			}
		}

		private void InitPumpGroupWorkGrid()
		{
			this.bInitGrig = false;
			DataTable dataTable = new DataTable();
			dataTable.Columns.Add("Item");
			dataTable.Columns.Add("Value");
			this.addDataRow(ref dataTable, "偏差度", "");
			this.addDataRow(ref dataTable, "扬程最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "流量最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "效率最大偏差(%)", 10.0);
			this.addDataRow(ref dataTable, "工况", "");
			this.addDataRow(ref dataTable, "流体类型", "清水");
			this.addDataRow(ref dataTable, "工作温度(℃)", 20.0);
			this.addDataRow(ref dataTable, "管路", 1);
			this.addDataRow(ref dataTable, "静扬程", 0.0);
			this.addDataRow(ref dataTable, "工况限制", "");
			this.addDataRow(ref dataTable, "吸水性能校核", "1");
			this.addDataRow(ref dataTable, "当地大气压(MPa)", 0.101325);
			this.addDataRow(ref dataTable, "吸水管路损失(mH2O)", 0.0);
			this.addDataRow(ref dataTable, "安装高度(m)", 0.0);
			this.addDataRow(ref dataTable, "安全系数", 1.1);
			this.addDataRow(ref dataTable, "最大承压(m)", 0.0);
			this.addDataRow(ref dataTable, "流体温度限制", "1");
			this.addDataRow(ref dataTable, "上限温度(℃)", 80.0);
			this.addDataRow(ref dataTable, "下限温度(℃)", 0.0);
			this.addDataRow(ref dataTable, "泵组形式", "");
			this.addDataRow(ref dataTable, "是否手动指定台数", "0");
			this.addDataRow(ref dataTable, "泵组台数", 2);
			this.dgvGWorkParas.DataSource = dataTable;
			this.bInitGrig = true;
		}

		private void dgvGWorkParas_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
		{
			if (e.RowIndex == 0 || e.RowIndex == 4 || e.RowIndex == 9 || e.RowIndex == 19)
			{
				using (Brush brush = new SolidBrush(this.dgvGWorkParas.GridColor))
				{
					using (Brush brush2 = new SolidBrush(e.CellStyle.BackColor))
					{
						using (Pen pen = new Pen(brush))
						{
							e.Graphics.FillRectangle(brush2, e.CellBounds);
							e.Graphics.DrawLine(pen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
							if (e.Value != null && e.ColumnIndex <= 0)
							{
								e.Graphics.DrawString((string)e.Value, new Font("黑体", 11f, FontStyle.Bold), Brushes.Black, (float)(e.CellBounds.X + 2), (float)(e.CellBounds.Y + 5), StringFormat.GenericDefault);
							}
							e.Handled = true;
						}
					}
				}
				e.CellStyle.BackColor = Color.YellowGreen;
				e.CellStyle.ForeColor = Color.Black;
			}
		}

		private void InitGroupPumpList()
		{
			this.tnGAutob = new TreeNode("并联");
			this.tnGAutob.Tag = "Auto";
			this.tnGAutoc = new TreeNode("串联");
			this.tnGAutoc.Tag = "Auto";
			this.tnGManb = new TreeNode("并联");
			this.tnGManb.Tag = "Man";
			this.tnGMnac = new TreeNode("串联");
			this.tnGMnac.Tag = "Man";
			TreeNode treeNode = new TreeNode("泵组选型方案");
			treeNode.Tag = "";
			TreeNode treeNode2 = new TreeNode("自动选型方案");
			treeNode2.Tag = "Auto";
			TreeNode treeNode3 = new TreeNode("手动选型方案");
			treeNode3.Tag = "Man";
			treeNode2.Nodes.AddRange(new TreeNode[]
			{
				this.tnGAutob,
				this.tnGAutoc
			});
			treeNode3.Nodes.AddRange(new TreeNode[]
			{
				this.tnGManb,
				this.tnGMnac
			});
			treeNode.Nodes.Add(treeNode2);
			treeNode.Nodes.Add(treeNode3);
			this.tvPumpGroupsResult.Nodes.Add(treeNode);
			this.tvPumpGroupsResult.ExpandAll();
		}

		private void InitPumpResultTreeview()
		{
			this.tnListSingle = new TreeNode("单泵选型方案", 0, 0);
			this.tnListGroup = new TreeNode("泵组选型方案", 0, 0);
			this.tvResultPumps.Nodes.AddRange(new TreeNode[]
			{
				this.tnListSingle,
				this.tnListGroup
			});
			string path = Path.Combine(Product.UserDataLocation, "HYPumpSelectionResult.XML");
			this.LoadPumpSelectionPlan(path);
		}

		private bool LoadPumpSelectionPlan(string path)
		{
			HYPumpDataXMLInfo hypumpDataXMLInfo = new HYPumpDataXMLInfo(path);
			this.m_arrSinglePumpsList = new List<HYPumpData>();
			this.m_arrGroupPumpsList = new List<HYGroupPumpData>();
			this.m_arrSinglePumpsList = hypumpDataXMLInfo.LoadPumpSelectionResult(this.m_arrSinglePumpsList);
			this.m_arrGroupPumpsList = hypumpDataXMLInfo.LoadPumpGroupSelectionResult(this.m_arrGroupPumpsList);
			this.AddPumpsDataToTV();
			this.pumpsSelResult.Rows.Clear();
			return true;
		}

		private void InitComboBoxLine()
		{
			this.comboBoxLine.Items.Clear();
			this.comboBoxLine.Items.Add("流量-扬程曲线");
			this.comboBoxLine.Items.Add("流量-功率曲线");
			this.comboBoxLine.Items.Add("流量-效率曲线");
			this.comboBoxLine.Items.Add("流量-NPSH曲线");
			this.comboBoxLine.SelectedIndex = 0;
		}

		private void UpdataChartData(HYPumpData pumpdata)
		{
			switch (this.comboBoxLine.SelectedIndex)
			{
			case 0:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_H);
				break;
			case 1:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_N);
				break;
			case 2:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_E);
				break;
			case 3:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_NPSH);
				break;
			}
			this.hyPumpGraphChart.SetMarker(this.checkBoxPoint.Checked);
			this.hyPumpGraphChart.ShowXYTitle(this.checkBoxTitle.Checked);
		}

		private void UpdataChartData(HYGroupPumpData pumpdata)
		{
			switch (this.comboBoxLine.SelectedIndex)
			{
			case 0:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_H);
				break;
			case 1:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_N);
				break;
			case 2:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_E);
				break;
			case 3:
				this.hyPumpGraphChart.Draw(pumpdata, EPumpCurveType.ePumpCurve_NPSH);
				break;
			}
			this.hyPumpGraphChart.SetMarker(this.checkBoxPoint.Checked);
			this.hyPumpGraphChart.ShowXYTitle(this.checkBoxTitle.Checked);
		}

		private void AddPumpsDataToTV()
		{
			if (this.m_arrSinglePumpsList != null && this.m_arrSinglePumpsList.Count != 0)
			{
				this.tnListSingle.Nodes.Clear();
				foreach (HYPumpData hypumpData in this.m_arrSinglePumpsList)
				{
					TreeNode treeNode = new TreeNode(hypumpData.StrSpecification, 1, 1);
					treeNode.Tag = hypumpData;
					this.tnListSingle.Nodes.Add(treeNode);
				}
			}
			if (this.m_arrGroupPumpsList != null && this.m_arrGroupPumpsList.Count != 0)
			{
				this.tnListGroup.Nodes.Clear();
				foreach (HYGroupPumpData hygroupPumpData in this.m_arrGroupPumpsList)
				{
					TreeNode treeNode2;
					if (hygroupPumpData.m_bIsParallel)
					{
						treeNode2 = new TreeNode(hygroupPumpData.m_strGroupName, 2, 2);
					}
					else
					{
						treeNode2 = new TreeNode(hygroupPumpData.m_strGroupName, 3, 3);
					}
					treeNode2.Tag = hygroupPumpData;
					this.tnListGroup.Nodes.Add(treeNode2);
				}
			}
			this.tvResultPumps.ExpandAll();
			if (this.tnListSingle.Nodes.Count == 0)
			{
				if (this.tnListGroup.Nodes.Count != 0)
				{
					this.tvResultPumps.SelectedNode = this.tnListGroup.Nodes[0];
					return;
				}
			}
			else
			{
				this.tvResultPumps.SelectedNode = this.tnListSingle.Nodes[0];
			}
		}

		private void checkBoxPoint_CheckedChanged(object sender, EventArgs e)
		{
			this.hyPumpGraphChart.SetMarker(this.checkBoxPoint.Checked);
		}

		private void checkBoxTitle_CheckedChanged(object sender, EventArgs e)
		{
			this.hyPumpGraphChart.ShowXYTitle(this.checkBoxTitle.Checked);
		}

		private void tvPumpGroupsResult_BeforeSelect(object sender, TreeViewCancelEventArgs e)
		{
			if (this.tvPumpGroupsResult.SelectedNode != null)
			{
				this.tvPumpGroupsResult.SelectedNode.BackColor = Color.White;
				this.tvPumpGroupsResult.SelectedNode.ForeColor = Color.Black;
			}
		}

		private void tvResultPumps_AfterSelect(object sender, TreeViewEventArgs e)
		{
			this.tvResultPumps.SelectedNode.BackColor = Color.DodgerBlue;
			this.tvResultPumps.SelectedNode.ForeColor = Color.White;
			TreeNode selectedNode = this.tvResultPumps.SelectedNode;
			if (selectedNode.Tag is HYPumpData)
			{
				this.bInitGrig = false;
				this.pumpsSelResult.Rows.Clear();
				HYPumpData hypumpData = selectedNode.Tag as HYPumpData;
				object[] values = new object[]
				{
					hypumpData.StrSpecification,
					hypumpData.StrBaseType,
					hypumpData.StrStructType,
					hypumpData.StrFitType,
					hypumpData.DQ,
					hypumpData.DH,
					hypumpData.DEffection,
					hypumpData.DPumpPower,
					hypumpData.StrUse
				};
				this.pumpsSelResult.Rows.Add(values);
				this.pumpsSelResult.ClearSelection();
				this.UpdataChartData(hypumpData);
				this.m_lCurPump = hypumpData;
				this.m_blCurSelectedIsPump = true;
				this.bInitGrig = true;
			}
			if (selectedNode.Tag is HYGroupPumpData)
			{
				this.bInitGrig = false;
				this.pumpsSelResult.Rows.Clear();
				HYGroupPumpData hygroupPumpData = selectedNode.Tag as HYGroupPumpData;
				foreach (HYPumpData hypumpData2 in hygroupPumpData.m_arrData)
				{
					object[] values2 = new object[]
					{
						hypumpData2.StrSpecification,
						hypumpData2.StrBaseType,
						hypumpData2.StrStructType,
						hypumpData2.StrFitType,
						hypumpData2.DQ,
						hypumpData2.DH,
						hypumpData2.DEffection,
						hypumpData2.DPumpPower,
						hypumpData2.StrUse
					};
					this.pumpsSelResult.Rows.Add(values2);
				}
				this.pumpsSelResult.ClearSelection();
				this.UpdataChartData(hygroupPumpData);
				this.m_lCurGroupPump = hygroupPumpData;
				this.m_blCurSelectedIsPump = false;
				this.bInitGrig = true;
			}
		}

		private void pumpsSelResult_SelectionChanged(object sender, EventArgs e)
		{
			try
			{
				if (this.bInitGrig)
				{
					if (this.pumpsSelResult.SelectedRows.Count != 0)
					{
						string sSPEC = this.pumpsSelResult.Rows[this.pumpsSelResult.SelectedRows[0].Index].Cells[0].Value.ToString();
						this.UpdataChartData(this.GetHYpumpBySPEC(sSPEC));
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void comboBoxLine_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.m_blCurSelectedIsPump)
			{
				if (this.m_lCurPump == null)
				{
					return;
				}
				this.UpdataChartData(this.m_lCurPump);
				return;
			}
			else
			{
				if (this.m_lCurGroupPump == null)
				{
					return;
				}
				this.UpdataChartData(this.m_lCurGroupPump);
				return;
			}
		}

		private void btnLClear_Click(object sender, EventArgs e)
		{
			if (this.m_arrSinglePumpsList.Count == 0 && this.m_arrGroupPumpsList.Count == 0)
			{
				return;
			}
			this.m_arrSinglePumpsList.Clear();
			this.m_arrGroupPumpsList.Clear();
			this.tnListGroup.Nodes.Clear();
			this.tnListSingle.Nodes.Clear();
			this.pumpsSelResult.Rows.Clear();
			this.hyPumpGraphChart.Series[0].Points.Clear();
			this.m_bPumpListChange = true;
		}

		private void btnLDel_Click(object sender, EventArgs e)
		{
			if (this.tvResultPumps.SelectedNode == null)
			{
				return;
			}
			TreeNode selectedNode = this.tvResultPumps.SelectedNode;
			if (selectedNode.Tag is HYPumpData)
			{
				this.m_arrSinglePumpsList.Remove(selectedNode.Tag as HYPumpData);
				this.tvResultPumps.Nodes.Remove(selectedNode);
				this.pumpsSelResult.Rows.Clear();
				this.hyPumpGraphChart.Series[0].Points.Clear();
			}
			else if (selectedNode.Tag is HYGroupPumpData)
			{
				this.m_arrGroupPumpsList.Remove(selectedNode.Tag as HYGroupPumpData);
				this.tvResultPumps.Nodes.Remove(selectedNode);
				this.pumpsSelResult.Rows.Clear();
				this.hyPumpGraphChart.Series[0].Points.Clear();
			}
			this.m_bPumpListChange = true;
		}

		private void btnLPumpLookup_Click(object sender, EventArgs e)
		{
			HYPumpData pumpdata;
			if (this.pumpsSelResult.SelectedRows.Count == 0)
			{
				if (this.m_blCurSelectedIsPump)
				{
					if (this.m_lCurPump == null)
					{
						return;
					}
					pumpdata = this.m_lCurPump;
				}
				else
				{
					if (this.m_lCurGroupPump == null || this.m_lCurGroupPump.m_arrData.Count == 0)
					{
						return;
					}
					pumpdata = this.m_lCurGroupPump.m_arrData[0];
				}
			}
			else
			{
				string sSPEC = this.pumpsSelResult.Rows[this.pumpsSelResult.SelectedRows[0].Index].Cells[0].Value.ToString();
				pumpdata = this.GetHYpumpBySPEC(sSPEC);
			}
			new FormSeeThePump(pumpdata).ShowDialog();
		}

		private void btnAddToList_Click(object sender, EventArgs e)
		{
			switch (this.PumpSelPage.SelectedIndex)
			{
			case 0:
				this.btnsSel_Click(null, null);
				break;
			case 1:
				this.btnGSel_Click(null, null);
				break;
			}
			this.AddPumpsDataToTV();
		}

		private void btnSave_Click(object sender, EventArgs e)
		{
			this.m_bPumpListChange = false;
			string path = Path.Combine(Product.UserDataLocation, "HYPumpSelectionResult.XML");
			if (File.Exists(path))
			{
				File.Delete(path);
			}
			if (new HYPumpDataXMLInfo(path).SavePumpSelectionResult(this.tvResultPumps))
			{
				YJKMessageBox.Show("保存成功！");
			}
		}

		private void btnImport_Click(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "水泵选型方案|*.xml";
			openFileDialog.RestoreDirectory = true;
			openFileDialog.FilterIndex = 1;
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				string fileName = openFileDialog.FileName;
				if (this.LoadPumpSelectionPlan(fileName))
				{
					YJKMessageBox.Show("导入成功！");
				}
			}
			this.m_bPumpListChange = true;
		}

		private void btnExport_Click(object sender, EventArgs e)
		{
			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "水泵选型方案|*.xml";
			saveFileDialog.RestoreDirectory = true;
			saveFileDialog.FilterIndex = 1;
			if (saveFileDialog.ShowDialog() == DialogResult.OK)
			{
				string fileName = saveFileDialog.FileName;
				if (File.Exists(fileName))
				{
					File.Delete(fileName);
				}
				if (new HYPumpDataXMLInfo(fileName).SavePumpSelectionResult(this.tvResultPumps))
				{
					YJKMessageBox.Show("导出成功！");
				}
			}
		}

		private void btnClose_Click(object sender, EventArgs e)
		{
			this.SaveUserData();
			if (!this.m_bPumpListChange)
			{
				base.DialogResult = DialogResult.Cancel;
				return;
			}
			DialogResult dialogResult = YJKMessageBox.Show("水泵选型数据未保存，是否进行保存？", MessageBoxButtons.YesNoCancel);
			if (dialogResult == DialogResult.Cancel)
			{
				base.DialogResult = DialogResult.None;
				return;
			}
			if (dialogResult == DialogResult.Yes)
			{
				string path = Path.Combine(Product.UserDataLocation, "HYPumpSelectionResult.XML");
				if (File.Exists(path))
				{
					File.Delete(path);
				}
				new HYPumpDataXMLInfo(path).SavePumpSelectionResult(this.tvResultPumps);
				this.m_bPumpListChange = false;
				base.DialogResult = dialogResult;
				return;
			}
			if (dialogResult != DialogResult.No)
			{
				return;
			}
			this.m_bPumpListChange = false;
			base.DialogResult = DialogResult.Cancel;
		}

		private void hytb_TextChanged(object sender, EventArgs e)
		{
		}

		private void chb_CheckedChanged(object sender, EventArgs e)
		{
			if (!(sender is CheckBox))
			{
				return;
			}
			CheckBox checkBox = sender as CheckBox;
			string name = checkBox.Name;
			if (name == "chbSFactory")
			{
				this.cmbSFactory.Enabled = checkBox.Checked;
				return;
			}
			if (name == "chbSPumpType")
			{
				this.cmbSPumpType.Enabled = checkBox.Checked;
				return;
			}
			if (name == "chkSStructType")
			{
				this.cmbSStructType.Enabled = checkBox.Checked;
				return;
			}
			if (name == "chbSInstallType")
			{
				this.cmbSInstallType.Enabled = checkBox.Checked;
				return;
			}
			if (name == "chbSLunzhouPos")
			{
				this.cmbSLunzhouPos.Enabled = checkBox.Checked;
				return;
			}
			if (!(name == "chbSUse"))
			{
				return;
			}
			this.cmbSUse.Enabled = checkBox.Checked;
		}

		private void cmbpumpunity_SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				if (sender is ComboBox)
				{
					ComboBox comboBox = sender as ComboBox;
					string name = comboBox.Name;
					if (!(name == "cmbpumpHunity"))
					{
						if (name == "cmbpumpQunity")
						{
							this.hyTbSPumpQ.Text = this.ChangePumpQUnionty(ref this.dSQMin, this.hyTbSPumpQ.Text, int.Parse(this.hyTbSPumpQ.Tag.ToString()), comboBox.SelectedIndex);
							this.hyTbSPumpMaxQ.Text = this.ChangePumpQUnionty(ref this.dSQMax, this.hyTbSPumpMaxQ.Text, int.Parse(this.hyTbSPumpMaxQ.Tag.ToString()), comboBox.SelectedIndex);
							this.hyTbSPumpQ.Tag = comboBox.SelectedIndex;
							this.hyTbSPumpMaxQ.Tag = comboBox.SelectedIndex;
						}
					}
					else
					{
						this.hyTbSPumpH.Text = this.ChangePumpHUnionty(ref this.dSHMin, this.hyTbSPumpH.Text, int.Parse(this.hyTbSPumpH.Tag.ToString()), comboBox.SelectedIndex);
						this.hyTbSPumpMaxH.Text = this.ChangePumpHUnionty(ref this.dSHMax, this.hyTbSPumpMaxH.Text, int.Parse(this.hyTbSPumpMaxH.Tag.ToString()), comboBox.SelectedIndex);
						this.hyTbSPumpH.Tag = comboBox.SelectedIndex;
						this.hyTbSPumpMaxH.Tag = comboBox.SelectedIndex;
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void cmbS_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (!(sender is ComboBox))
			{
				return;
			}
			ComboBox comboBox = sender as ComboBox;
			string[] array = null;
			if (comboBox.Name == "cmbSPumpType")
			{
				string a = comboBox.SelectedItem.ToString();
				if (!(a == "全部"))
				{
					if (!(a == "离心式"))
					{
						if (!(a == "轴流式"))
						{
							if (a == "混流式")
							{
								array = this.strPumpHunLiu;
							}
						}
						else
						{
							array = this.strPumpZhouLiu;
						}
					}
					else
					{
						array = this.strPumpLiXin;
					}
				}
				if (array == null)
				{
					this.cmbSStructType.Items.Clear();
					this.cmbSStructType.Items.Add("全部");
					this.cmbSStructType.SelectedIndex = 0;
					return;
				}
				this.cmbSStructType.Items.Clear();
				this.cmbSStructType.Items.AddRange(array);
				this.cmbSStructType.SelectedIndex = 0;
			}
		}

		private void rbSRangeMatch_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rbSRangeMatch.Checked)
			{
				this.hyTbSPumpMaxQ.Enabled = true;
				this.hyTbSPumpMaxH.Enabled = true;
				this.hyTbSPumpMaxE.Enabled = true;
				this.label4.Enabled = true;
				this.label5.Enabled = true;
				this.label6.Enabled = true;
				this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
				{
					0,
					1,
					2,
					3
				}, false);
				return;
			}
			if (this.rbSPiancha.Checked)
			{
				this.hyTbSPumpMaxQ.Enabled = false;
				this.hyTbSPumpMaxH.Enabled = false;
				this.hyTbSPumpMaxE.Enabled = false;
				this.label4.Enabled = false;
				this.label5.Enabled = false;
				this.label6.Enabled = false;
				this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
				{
					0,
					1,
					2,
					3
				}, true);
				this.dgvSWorkParas.FirstDisplayedScrollingRowIndex = 0;
			}
		}

		private void dgvSWorkParas_CellValueChanged(object sender, DataGridViewCellEventArgs e)
		{
			if (!this.bInitGrig)
			{
				return;
			}
			if (this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "")
			{
				YJKMessageBox.Information("cancel");
				this.dgvSWorkParas.CancelEdit();
			}
			if (e.RowIndex == 7 && e.ColumnIndex == 1)
			{
				string a = this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
				if (a == "开式")
				{
					this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, true);
					this.dgvSWorkParas.Rows[11].Cells[0].Value = "当地大气压(MPa)";
					this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.101325;
					this.dgvSWorkParas.Rows[12].Cells[0].Value = "吸水管路损失(mH2O)";
					this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
					this.dgvSWorkParas.Rows[13].Cells[0].Value = "安装高度(m)";
					this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
					return;
				}
				if (!(a == "闭式"))
				{
					return;
				}
				this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, false);
				this.dgvSWorkParas.Rows[11].Cells[0].Value = "定压点压力(MPa)";
				this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.6;
				this.dgvSWorkParas.Rows[12].Cells[0].Value = "定压点到入口管路损失(mH2O)";
				this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
				this.dgvSWorkParas.Rows[13].Cells[0].Value = "定压点到入口高差(m)";
				this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
				return;
			}
			else
			{
				if (e.RowIndex != 10 || e.ColumnIndex != 1)
				{
					if (e.RowIndex == 16 && e.ColumnIndex == 1)
					{
						if (this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().Contains("不") || this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "0")
						{
							this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
							{
								17,
								18
							}, false);
							return;
						}
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							17,
							18
						}, true);
					}
					return;
				}
				if (this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().Contains("不") || this.dgvSWorkParas.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "0")
				{
					this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
					{
						11,
						12,
						13,
						14
					}, false);
					return;
				}
				this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
				{
					11,
					12,
					13,
					14
				}, true);
				return;
			}
		}

		private void defcmb_SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				string name = ((ComboBox)sender).Name;
				if (!(name == "PipeOpen"))
				{
					if (!(name == "DrawAbility"))
					{
						if (name == "TempLimit")
						{
							if (((ComboBox)sender).Text == "限制")
							{
								this.dgvSWorkParas.CurrentCell.Value = "限制";
								this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
								{
									17,
									18
								}, true);
							}
							else
							{
								this.dgvSWorkParas.CurrentCell.Value = "不限制";
								this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
								{
									17,
									18
								}, false);
							}
						}
					}
					else if (((ComboBox)sender).Text == "校核")
					{
						this.dgvSWorkParas.CurrentCell.Value = "校核";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, true);
					}
					else
					{
						this.dgvSWorkParas.CurrentCell.Value = "不校核";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, false);
					}
				}
				else if (((ComboBox)sender).Text == "开式")
				{
					this.dgvSWorkParas.CurrentCell.Value = "开式";
					this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, true);
					this.dgvSWorkParas.Rows[11].Cells[0].Value = "当地大气压(MPa)";
					this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.101325;
					this.dgvSWorkParas.Rows[12].Cells[0].Value = "吸水管路损失(mH2O)";
					this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
					this.dgvSWorkParas.Rows[13].Cells[0].Value = "安装高度(m)";
					this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
				}
				else
				{
					this.dgvSWorkParas.CurrentCell.Value = "闭式";
					this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, false);
					this.dgvSWorkParas.Rows[11].Cells[0].Value = "定压点压力(MPa)";
					this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.6;
					this.dgvSWorkParas.Rows[12].Cells[0].Value = "定压点到入口管路损失(mH2O)";
					this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
					this.dgvSWorkParas.Rows[13].Cells[0].Value = "定压点到入口高差(m)";
					this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
				}
				(sender as ComboBox).Visible = false;
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void dgvSWorkParas_DataSourceChanged(object sender, EventArgs e)
		{
			try
			{
				if (this.dgvSWorkParas.Rows[7].Cells[1].Value.ToString() != null && this.dgvSWorkParas.Rows[7].Cells[1].ColumnIndex == 1)
				{
					if (this.dgvSWorkParas.Rows[7].Cells[1].Value.ToString() == "0")
					{
						this.dgvSWorkParas.Rows[7].Cells[1].Value = "闭式";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, false);
						this.dgvSWorkParas.Rows[11].Cells[0].Value = "定压点压力(MPa)";
						this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.6;
						this.dgvSWorkParas.Rows[12].Cells[0].Value = "定压点到入口管路损失(mH2O)";
						this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
						this.dgvSWorkParas.Rows[13].Cells[0].Value = "定压点到入口高差(m)";
						this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
					}
					else if (this.dgvSWorkParas.Rows[7].Cells[1].Value.ToString() == "1")
					{
						this.dgvSWorkParas.Rows[7].Cells[1].Value = "开式";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 8, true);
						this.dgvSWorkParas.Rows[11].Cells[0].Value = "当地大气压(MPa)";
						this.dgvSWorkParas.Rows[11].Cells[1].Value = 0.101325;
						this.dgvSWorkParas.Rows[12].Cells[0].Value = "吸水管路损失(mH2O)";
						this.dgvSWorkParas.Rows[12].Cells[1].Value = 0.0;
						this.dgvSWorkParas.Rows[13].Cells[0].Value = "安装高度(m)";
						this.dgvSWorkParas.Rows[13].Cells[1].Value = 0.0;
					}
				}
				if (this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString() != null && this.dgvSWorkParas.Rows[10].Cells[1].ColumnIndex == 1)
				{
					this.dgvSWorkParas.Rows[10].Cells[1].Tag = this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString();
					if (this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString() == "0")
					{
						this.dgvSWorkParas.Rows[10].Cells[1].Value = "不校核";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, false);
					}
					else if (this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString() == "1")
					{
						this.dgvSWorkParas.Rows[10].Cells[1].Value = "校核";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, true);
					}
				}
				if (this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString() != null && this.dgvSWorkParas.Rows[16].Cells[1].ColumnIndex == 1)
				{
					this.dgvSWorkParas.Rows[16].Cells[1].Tag = this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString();
					if (this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString() == "0")
					{
						this.dgvSWorkParas.Rows[16].Cells[1].Value = "不限制";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							17,
							18
						}, false);
					}
					else if (this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString() == "1")
					{
						this.dgvSWorkParas.Rows[16].Cells[1].Value = "限制";
						this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, new int[]
						{
							17,
							18
						}, true);
					}
				}
				for (int i = 0; i < this.dgvSWorkParas.Rows.Count; i++)
				{
					this.dgvSWorkParas.Rows[i].Cells[0].ReadOnly = true;
					if (i == 7 || i == 10 || i == 16)
					{
						this.dgvSWorkParas.Rows[i].Cells[1].ReadOnly = true;
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void dgvSWorkParas_CurrentCellChanged(object sender, EventArgs e)
		{
			try
			{
				if (this.bInitGrig)
				{
					if (this.dgvSWorkParas.CurrentCell != null)
					{
						if (this.dgvSWorkParas.CurrentCell.RowIndex == 7 && this.dgvSWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle = this.dgvSWorkParas.GetCellDisplayRectangle(this.dgvSWorkParas.CurrentCell.ColumnIndex, this.dgvSWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvSWorkParas.CurrentCell.Value.ToString() == "开式")
							{
								this.cmb_sPipeOpen.Text = "开式";
							}
							else
							{
								this.cmb_sPipeOpen.Text = "闭式";
							}
							this.cmb_sPipeOpen.Left = cellDisplayRectangle.Left;
							this.cmb_sPipeOpen.Top = cellDisplayRectangle.Top;
							this.cmb_sPipeOpen.Width = cellDisplayRectangle.Width;
							this.cmb_sPipeOpen.Height = cellDisplayRectangle.Height;
							this.cmb_sPipeOpen.Visible = true;
							this.cmb_sDrawAbility.Visible = false;
							this.cmb_sTempLimit.Visible = false;
						}
						else if (this.dgvSWorkParas.CurrentCell.RowIndex == 10 && this.dgvSWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle2 = this.dgvSWorkParas.GetCellDisplayRectangle(this.dgvSWorkParas.CurrentCell.ColumnIndex, this.dgvSWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvSWorkParas.CurrentCell.Value.ToString() == "校核")
							{
								this.cmb_sDrawAbility.Text = "校核";
							}
							else
							{
								this.cmb_sDrawAbility.Text = "不校核";
							}
							this.cmb_sDrawAbility.Left = cellDisplayRectangle2.Left;
							this.cmb_sDrawAbility.Top = cellDisplayRectangle2.Top;
							this.cmb_sDrawAbility.Width = cellDisplayRectangle2.Width;
							this.cmb_sDrawAbility.Height = cellDisplayRectangle2.Height;
							this.cmb_sDrawAbility.Visible = true;
							this.cmb_sPipeOpen.Visible = false;
							this.cmb_sTempLimit.Visible = false;
						}
						else if (this.dgvSWorkParas.CurrentCell.RowIndex == 16 && this.dgvSWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle3 = this.dgvSWorkParas.GetCellDisplayRectangle(this.dgvSWorkParas.CurrentCell.ColumnIndex, this.dgvSWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvSWorkParas.CurrentCell.Value.ToString() == "限制")
							{
								this.cmb_sTempLimit.Text = "限制";
							}
							else
							{
								this.cmb_sTempLimit.Text = "不限制";
							}
							this.cmb_sTempLimit.Left = cellDisplayRectangle3.Left;
							this.cmb_sTempLimit.Top = cellDisplayRectangle3.Top;
							this.cmb_sTempLimit.Width = cellDisplayRectangle3.Width;
							this.cmb_sTempLimit.Height = cellDisplayRectangle3.Height;
							this.cmb_sTempLimit.Visible = true;
							this.cmb_sPipeOpen.Visible = false;
							this.cmb_sDrawAbility.Visible = false;
						}
						else
						{
							this.cmb_sPipeOpen.Visible = false;
							this.cmb_sDrawAbility.Visible = false;
							this.cmb_sTempLimit.Visible = false;
						}
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void dgvSWorkParas_Scroll(object sender, ScrollEventArgs e)
		{
			this.cmb_sPipeOpen.Visible = false;
			this.cmb_sDrawAbility.Visible = false;
			this.cmb_sTempLimit.Visible = false;
		}

		private void btnsAuto_Click(object sender, EventArgs e)
		{
			try
			{
				this.GetPumpSingleSelData();
				if (this.singlePumpSel.AutoSelPump(this.m_allPumps))
				{
					int num = 1;
					while (num < this.dgvSinglePumpResult.RowCount && !(this.dgvSinglePumpResult.Rows[num].Cells[0].Value.ToString() == "手动选型列表"))
					{
						this.dgvSinglePumpResult.Rows.RemoveAt(num--);
						num++;
					}
					if (this.singlePumpSel.m_vecSelData.Count == 0)
					{
						YJKMessageBox.Information("没有符合条件的水泵！");
					}
					else
					{
						foreach (HYPumpData hypumpData in this.singlePumpSel.m_vecSelData)
						{
							object[] values = new object[]
							{
								hypumpData.StrSpecification,
								hypumpData.StrBaseType,
								hypumpData.StrStructType,
								hypumpData.StrFitType,
								hypumpData.DQ,
								hypumpData.DH,
								hypumpData.DEffection,
								hypumpData.DPumpPower,
								hypumpData.StrUse
							};
							this.dgvSinglePumpResult.Rows.Insert(1, values);
							DataGridViewGroupCell cell = this.dgvSinglePumpResult.Rows[1].Cells[0] as DataGridViewGroupCell;
							this.cellAuto.AddChildCell(cell);
						}
						YJKMessageBox.Information("水泵自动选型成功！");
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void btnsMan_Click(object sender, EventArgs e)
		{
			FormPumpProduct formPumpProduct = new FormPumpProduct("单泵选型");
			formPumpProduct.ShowDialog();
			foreach (HYPumpData hypumpData in formPumpProduct.m_arrSelPumps)
			{
				object[] values = new object[]
				{
					hypumpData.StrSpecification,
					hypumpData.StrBaseType,
					hypumpData.StrStructType,
					hypumpData.StrFitType,
					hypumpData.DQ,
					hypumpData.DH,
					hypumpData.DEffection,
					hypumpData.DPumpPower,
					hypumpData.StrUse
				};
				this.dgvSinglePumpResult.Rows.Add(values);
				DataGridViewGroupCell cell = this.dgvSinglePumpResult.Rows[this.dgvSinglePumpResult.RowCount - 1].Cells[0] as DataGridViewGroupCell;
				this.cellMan.AddChildCell(cell);
			}
		}

		private void btnsDel_Click(object sender, EventArgs e)
		{
			int index = this.dgvSinglePumpResult.SelectedRows[0].Index;
			if (this.dgvSinglePumpResult.Rows[index].Cells[0].Value.ToString().Contains("选型列表"))
			{
				YJKMessageBox.Information("请选择正确的水泵数据！！");
				return;
			}
			if (YJKMessageBox.Show("是否确定要删除选中的水泵？", MessageBoxButtons.OKCancel) == DialogResult.OK)
			{
				this.dgvSinglePumpResult.Rows.Remove(this.dgvSinglePumpResult.Rows[index]);
			}
		}

		private void btnsSel_Click(object sender, EventArgs e)
		{
			int rowIndex = this.dgvSinglePumpResult.SelectedCells[0].RowIndex;
			if (this.dgvSinglePumpResult.Rows[rowIndex].Cells[0].Value.ToString().Contains("选型列表"))
			{
				YJKMessageBox.Information("请选择正确的水泵数据！！");
				return;
			}
			List<string> list = new List<string>();
			if (this.m_arrSinglePumpsList == null)
			{
				this.m_arrSinglePumpsList = new List<HYPumpData>();
			}
			else
			{
				foreach (HYPumpData hypumpData in this.m_arrSinglePumpsList)
				{
					list.Add(hypumpData.StrSpecification);
				}
			}
			HYPumpData hypumpBySPEC = this.GetHYpumpBySPEC(this.dgvSinglePumpResult.Rows[rowIndex].Cells[0].Value.ToString());
			if (list.Contains(hypumpBySPEC.StrSpecification))
			{
				YJKMessageBox.Information("选型清单中已存在该水泵");
				return;
			}
			this.m_arrSinglePumpsList.Add(hypumpBySPEC);
			this.m_bPumpListChange = true;
			YJKMessageBox.Information("加入清单成功！");
		}

		private void GetPumpSingleSelData()
		{
			List<bool> list = new List<bool>();
			list.Add(this.chbSFactory.Checked);
			list.Add(this.chbSPumpType.Checked);
			list.Add(this.chbSStructType.Checked);
			list.Add(this.chbSInstallType.Checked);
			list.Add(this.chbSLunzhouPos.Checked);
			list.Add(this.chbSUse.Checked);
			list.Add(this.chbSResistCorrede.Checked);
			list.Add(this.chbSPerfectSeal.Checked);
			list.Add(this.chbSSelfDraw.Checked);
			this.singlePumpSel.SetSelItemBools(list);
			List<string> list2 = new List<string>();
			list2.Add(this.cmbSFactory.SelectedItem.ToString());
			list2.Add(this.cmbSPumpType.SelectedItem.ToString());
			list2.Add(this.cmbSStructType.SelectedItem.ToString());
			list2.Add(this.cmbSInstallType.SelectedItem.ToString());
			list2.Add(this.cmbSLunzhouPos.SelectedItem.ToString());
			list2.Add(this.cmbSUse.SelectedItem.ToString());
			this.singlePumpSel.SetLimitSelText(list2);
			this.singlePumpSel.m_bRangeMatch = this.rbSRangeMatch.Checked;
			if (this.rbSRangeMatch.Checked)
			{
				this.singlePumpSel.m_dQNeeded = double.Parse(this.ChangePumpQUnionty(ref this.dSQMin, this.hyTbSPumpQ.Text, int.Parse(this.hyTbSPumpQ.Tag.ToString()), 0));
				this.singlePumpSel.m_dQNeeded_Max = double.Parse(this.ChangePumpQUnionty(ref this.dSQMax, this.hyTbSPumpMaxQ.Text, int.Parse(this.hyTbSPumpMaxQ.Tag.ToString()), 0));
				this.singlePumpSel.m_dHNeeded = double.Parse(this.ChangePumpHUnionty(ref this.dSHMin, this.hyTbSPumpH.Text, int.Parse(this.hyTbSPumpH.Tag.ToString()), 0));
				this.singlePumpSel.m_dHNeeded_Max = double.Parse(this.ChangePumpHUnionty(ref this.dSHMax, this.hyTbSPumpMaxH.Text, int.Parse(this.hyTbSPumpMaxH.Tag.ToString()), 0));
				this.singlePumpSel.m_dEfficiencyNeeded = double.Parse(this.hyTbSPumpE.Text.Trim());
				this.singlePumpSel.m_dEfficiency_Max = double.Parse(this.hyTbSPumpMaxE.Text.Trim());
			}
			else
			{
				this.singlePumpSel.m_dQNeeded = double.Parse(this.ChangePumpQUnionty(ref this.dSQMin, this.hyTbSPumpQ.Text, int.Parse(this.hyTbSPumpQ.Tag.ToString()), 0));
				this.singlePumpSel.m_dHNeeded = double.Parse(this.ChangePumpHUnionty(ref this.dSHMin, this.hyTbSPumpH.Text, int.Parse(this.hyTbSPumpH.Tag.ToString()), 0));
				this.singlePumpSel.m_dEfficiencyNeeded = double.Parse(this.hyTbSPumpE.Text.Trim());
				this.singlePumpSel.m_dHTolerance = double.Parse(this.dgvSWorkParas.Rows[1].Cells[1].Value.ToString()) / 100.0;
				this.singlePumpSel.m_dQTolerance = double.Parse(this.dgvSWorkParas.Rows[2].Cells[1].Value.ToString()) / 100.0;
				this.singlePumpSel.m_dETolerance = double.Parse(this.dgvSWorkParas.Rows[3].Cells[1].Value.ToString()) / 100.0;
			}
			bool flag = !this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString().Contains("不");
			list.Add(flag);
			this.singlePumpSel.m_bIsDrawAbility = flag;
			this.singlePumpSel.m_dTemperature = double.Parse(this.dgvSWorkParas.Rows[6].Cells[1].Value.ToString());
			string a = this.dgvSWorkParas.Rows[7].Cells[1].Value.ToString();
			if (!(a == "开式"))
			{
				if (a == "闭式")
				{
					this.singlePumpSel.m_bPipeOpen = false;
					this.singlePumpSel.m_dConstPressue = double.Parse(this.dgvSWorkParas.Rows[11].Cells[1].Value.ToString());
				}
			}
			else
			{
				this.singlePumpSel.m_bPipeOpen = true;
				this.singlePumpSel.m_dAirPressure = double.Parse(this.dgvSWorkParas.Rows[11].Cells[1].Value.ToString());
			}
			this.singlePumpSel.m_dDrawPipeLose = double.Parse(this.dgvSWorkParas.Rows[12].Cells[1].Value.ToString());
			this.singlePumpSel.m_dFitHeight = double.Parse(this.dgvSWorkParas.Rows[13].Cells[1].Value.ToString());
			this.singlePumpSel.m_dDrawSafeCofficient = double.Parse(this.dgvSWorkParas.Rows[14].Cells[1].Value.ToString());
			list.Add(true);
			this.singlePumpSel.m_dMaxPressure = double.Parse(this.dgvSWorkParas.Rows[15].Cells[1].Value.ToString());
			bool flag2 = !this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString().Contains("不");
			this.singlePumpSel.m_bTemp = flag2;
			list.Add(flag2);
			list.Add(flag2);
			this.singlePumpSel.m_dMaxTemp = double.Parse(this.dgvSWorkParas.Rows[17].Cells[1].Value.ToString());
			this.singlePumpSel.m_dMinTemp = double.Parse(this.dgvSWorkParas.Rows[18].Cells[1].Value.ToString());
			this.singlePumpSel.m_strFlowtype = this.dgvSWorkParas.Rows[5].Cells[1].Value.ToString();
			list.Add(false);
			this.singlePumpSel.SetLimitItemSel(list);
		}

		private void defgcmb_SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				string name = ((ComboBox)sender).Name;
				if (!(name == "PipeOpen"))
				{
					if (!(name == "DrawAbility"))
					{
						if (!(name == "TempLimit"))
						{
							if (name == "GroupNum")
							{
								if (((ComboBox)sender).Text == "自动确定")
								{
									this.dgvGWorkParas.CurrentCell.Value = "自动确定";
									this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 21, false);
								}
								else
								{
									this.dgvGWorkParas.CurrentCell.Value = "手动指定";
									this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 21, true);
								}
							}
						}
						else if (((ComboBox)sender).Text == "限制")
						{
							this.dgvGWorkParas.CurrentCell.Value = "限制";
							this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
							{
								17,
								18
							}, true);
						}
						else
						{
							this.dgvGWorkParas.CurrentCell.Value = "不限制";
							this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
							{
								17,
								18
							}, false);
						}
					}
					else if (((ComboBox)sender).Text == "校核")
					{
						this.dgvGWorkParas.CurrentCell.Value = "校核";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, true);
					}
					else
					{
						this.dgvGWorkParas.CurrentCell.Value = "不校核";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, false);
					}
				}
				else if (((ComboBox)sender).Text == "开式")
				{
					this.dgvGWorkParas.CurrentCell.Value = "开式";
					this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 8, true);
					this.dgvGWorkParas.Rows[11].Cells[0].Value = "当地大气压(MPa)";
					this.dgvGWorkParas.Rows[11].Cells[1].Value = 0.101325;
					this.dgvGWorkParas.Rows[12].Cells[0].Value = "吸水管路损失(mH2O)";
					this.dgvGWorkParas.Rows[12].Cells[1].Value = 0.0;
					this.dgvGWorkParas.Rows[13].Cells[0].Value = "安装高度(m)";
					this.dgvGWorkParas.Rows[13].Cells[1].Value = 0.0;
				}
				else
				{
					this.dgvGWorkParas.CurrentCell.Value = "闭式";
					this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 8, false);
					this.dgvGWorkParas.Rows[11].Cells[0].Value = "定压点压力(MPa)";
					this.dgvGWorkParas.Rows[11].Cells[1].Value = 0.6;
					this.dgvGWorkParas.Rows[12].Cells[0].Value = "定压点到入口管路损失(mH2O)";
					this.dgvGWorkParas.Rows[12].Cells[1].Value = 0.0;
					this.dgvGWorkParas.Rows[13].Cells[0].Value = "定压点到入口高差(m)";
					this.dgvGWorkParas.Rows[13].Cells[1].Value = 0.0;
				}
				(sender as ComboBox).Visible = false;
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void rbGRangeMatch_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rbGRangeMatch.Checked)
			{
				this.hytbGPumpMaxQ.Enabled = true;
				this.hytbGPumpMaxH.Enabled = true;
				this.hytbGPumpMaxE.Enabled = true;
				this.label7.Enabled = true;
				this.label8.Enabled = true;
				this.label9.Enabled = true;
				this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
				{
					0,
					1,
					2,
					3
				}, false);
				return;
			}
			if (this.rbGPiancha.Checked)
			{
				this.hytbGPumpMaxQ.Enabled = false;
				this.hytbGPumpMaxH.Enabled = false;
				this.hytbGPumpMaxE.Enabled = false;
				this.label7.Enabled = false;
				this.label8.Enabled = false;
				this.label9.Enabled = false;
				this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
				{
					0,
					1,
					2,
					3
				}, true);
				this.dgvGWorkParas.FirstDisplayedScrollingRowIndex = 0;
			}
		}

		private void cmbG_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (!(sender is ComboBox))
			{
				return;
			}
			ComboBox comboBox = sender as ComboBox;
			string[] array = null;
			if (comboBox.Name == "cmbGPumpType")
			{
				string a = comboBox.SelectedItem.ToString();
				if (!(a == "全部"))
				{
					if (!(a == "离心式"))
					{
						if (!(a == "轴流式"))
						{
							if (a == "混流式")
							{
								array = this.strPumpHunLiu;
							}
						}
						else
						{
							array = this.strPumpZhouLiu;
						}
					}
					else
					{
						array = this.strPumpLiXin;
					}
				}
				if (array == null)
				{
					this.cmbGStructType.Items.Clear();
					this.cmbGStructType.Items.Add("全部");
					this.cmbGStructType.SelectedIndex = 0;
					return;
				}
				this.cmbGStructType.Items.Clear();
				this.cmbGStructType.Items.AddRange(array);
				this.cmbGStructType.SelectedIndex = 0;
			}
		}

		private void dgvGWorkParas_CellValueChanged(object sender, DataGridViewCellEventArgs e)
		{
		}

		private void dgvGWorkParas_CurrentCellChanged(object sender, EventArgs e)
		{
			try
			{
				if (this.bInitGrig)
				{
					if (this.dgvGWorkParas.CurrentCell != null)
					{
						if (this.dgvGWorkParas.CurrentCell.RowIndex == 7 && this.dgvGWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle = this.dgvGWorkParas.GetCellDisplayRectangle(this.dgvGWorkParas.CurrentCell.ColumnIndex, this.dgvGWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvGWorkParas.CurrentCell.Value.ToString() == "开式")
							{
								this.cmb_gPipeOpen.Text = "开式";
							}
							else
							{
								this.cmb_gPipeOpen.Text = "闭式";
							}
							this.cmb_gPipeOpen.Left = cellDisplayRectangle.Left;
							this.cmb_gPipeOpen.Top = cellDisplayRectangle.Top;
							this.cmb_gPipeOpen.Width = cellDisplayRectangle.Width;
							this.cmb_gPipeOpen.Height = cellDisplayRectangle.Height;
							this.cmb_gPipeOpen.Visible = true;
							this.cmb_gDrawAbility.Visible = false;
							this.cmb_gTempLimit.Visible = false;
							this.cmb_gGroupNum.Visible = false;
						}
						else if (this.dgvGWorkParas.CurrentCell.RowIndex == 10 && this.dgvGWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle2 = this.dgvGWorkParas.GetCellDisplayRectangle(this.dgvGWorkParas.CurrentCell.ColumnIndex, this.dgvGWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvGWorkParas.CurrentCell.Value.ToString() == "校核")
							{
								this.cmb_gDrawAbility.Text = "校核";
							}
							else
							{
								this.cmb_gDrawAbility.Text = "不校核";
							}
							this.cmb_gDrawAbility.Left = cellDisplayRectangle2.Left;
							this.cmb_gDrawAbility.Top = cellDisplayRectangle2.Top;
							this.cmb_gDrawAbility.Width = cellDisplayRectangle2.Width;
							this.cmb_gDrawAbility.Height = cellDisplayRectangle2.Height;
							this.cmb_gDrawAbility.Visible = true;
							this.cmb_gPipeOpen.Visible = false;
							this.cmb_gTempLimit.Visible = false;
							this.cmb_gGroupNum.Visible = false;
						}
						else if (this.dgvGWorkParas.CurrentCell.RowIndex == 16 && this.dgvGWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle3 = this.dgvGWorkParas.GetCellDisplayRectangle(this.dgvGWorkParas.CurrentCell.ColumnIndex, this.dgvGWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvGWorkParas.CurrentCell.Value.ToString() == "限制")
							{
								this.cmb_gTempLimit.Text = "限制";
							}
							else
							{
								this.cmb_gTempLimit.Text = "不限制";
							}
							this.cmb_gTempLimit.Left = cellDisplayRectangle3.Left;
							this.cmb_gTempLimit.Top = cellDisplayRectangle3.Top;
							this.cmb_gTempLimit.Width = cellDisplayRectangle3.Width;
							this.cmb_gTempLimit.Height = cellDisplayRectangle3.Height;
							this.cmb_gTempLimit.Visible = true;
							this.cmb_gPipeOpen.Visible = false;
							this.cmb_gDrawAbility.Visible = false;
							this.cmb_gGroupNum.Visible = false;
						}
						else if (this.dgvGWorkParas.CurrentCell.RowIndex == 20 && this.dgvGWorkParas.CurrentCell.ColumnIndex == 1)
						{
							Rectangle cellDisplayRectangle4 = this.dgvGWorkParas.GetCellDisplayRectangle(this.dgvGWorkParas.CurrentCell.ColumnIndex, this.dgvGWorkParas.CurrentCell.RowIndex, false);
							if (this.dgvGWorkParas.CurrentCell.Value.ToString() == "自动确定")
							{
								this.cmb_gGroupNum.Text = "自动确定";
							}
							else
							{
								this.cmb_gGroupNum.Text = "手动指定";
							}
							this.cmb_gGroupNum.Left = cellDisplayRectangle4.Left;
							this.cmb_gGroupNum.Top = cellDisplayRectangle4.Top;
							this.cmb_gGroupNum.Width = cellDisplayRectangle4.Width;
							this.cmb_gGroupNum.Height = cellDisplayRectangle4.Height;
							this.cmb_gGroupNum.Visible = true;
							this.cmb_gPipeOpen.Visible = false;
							this.cmb_gDrawAbility.Visible = false;
							this.cmb_gTempLimit.Visible = false;
						}
						else
						{
							this.cmb_gPipeOpen.Visible = false;
							this.cmb_gDrawAbility.Visible = false;
							this.cmb_gGroupNum.Visible = false;
							this.cmb_gTempLimit.Visible = false;
						}
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void dgvGWorkParas_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
		{
			if (!this.bInitGrig)
			{
				return;
			}
			if (e.ColumnIndex == 0 || e.RowIndex == 7 || e.RowIndex == 10 || e.RowIndex == 16 || e.RowIndex == 20 || e.RowIndex == 0)
			{
				return;
			}
			if (!Regex.IsMatch(e.FormattedValue.ToString(), "^[+-]?\\d*[.]?\\d*$") || e.FormattedValue.ToString() == "")
			{
				YJKMessageBox.Information("请输入正确的数值格式，且数值不能为空！");
				e.Cancel = true;
				(sender as DataGridView).CancelEdit();
			}
		}

		private void dgvGWorkParas_Scroll(object sender, ScrollEventArgs e)
		{
			this.cmb_gPipeOpen.Visible = false;
			this.cmb_gDrawAbility.Visible = false;
			this.cmb_gTempLimit.Visible = false;
			this.cmb_gGroupNum.Visible = false;
		}

		private void dgvGWorkParas_DataSourceChanged(object sender, EventArgs e)
		{
			try
			{
				if (this.dgvGWorkParas.Rows[7].Cells[1].Value.ToString() != null && this.dgvGWorkParas.Rows[7].Cells[1].ColumnIndex == 1)
				{
					if (this.dgvGWorkParas.Rows[7].Cells[1].Value.ToString() == "0")
					{
						this.dgvGWorkParas.Rows[7].Cells[1].Value = "闭式";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 8, false);
						this.dgvGWorkParas.Rows[11].Cells[0].Value = "定压点压力(MPa)";
						this.dgvGWorkParas.Rows[11].Cells[1].Value = 0.6;
						this.dgvGWorkParas.Rows[12].Cells[0].Value = "定压点到入口管路损失(mH2O)";
						this.dgvGWorkParas.Rows[12].Cells[1].Value = 0.0;
						this.dgvGWorkParas.Rows[13].Cells[0].Value = "定压点到入口高差(m)";
						this.dgvGWorkParas.Rows[13].Cells[1].Value = 0.0;
					}
					else if (this.dgvGWorkParas.Rows[7].Cells[1].Value.ToString() == "1")
					{
						this.dgvGWorkParas.Rows[7].Cells[1].Value = "开式";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 8, true);
						this.dgvGWorkParas.Rows[11].Cells[0].Value = "当地大气压(MPa)";
						this.dgvGWorkParas.Rows[11].Cells[1].Value = 0.101325;
						this.dgvGWorkParas.Rows[12].Cells[0].Value = "吸水管路损失(mH2O)";
						this.dgvGWorkParas.Rows[12].Cells[1].Value = 0.0;
						this.dgvGWorkParas.Rows[13].Cells[0].Value = "安装高度(m)";
						this.dgvGWorkParas.Rows[13].Cells[1].Value = 0.0;
					}
				}
				if (this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString() != null && this.dgvGWorkParas.Rows[10].Cells[1].ColumnIndex == 1)
				{
					this.dgvGWorkParas.Rows[10].Cells[1].Tag = this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString();
					if (this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString() == "0")
					{
						this.dgvGWorkParas.Rows[10].Cells[1].Value = "不校核";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, false);
					}
					else if (this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString() == "1")
					{
						this.dgvGWorkParas.Rows[10].Cells[1].Value = "校核";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							11,
							12,
							13,
							14
						}, true);
					}
				}
				if (this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString() != null && this.dgvGWorkParas.Rows[16].Cells[1].ColumnIndex == 1)
				{
					this.dgvGWorkParas.Rows[16].Cells[1].Tag = this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString();
					if (this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString() == "0")
					{
						this.dgvGWorkParas.Rows[16].Cells[1].Value = "不限制";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							17,
							18
						}, false);
					}
					else if (this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString() == "1")
					{
						this.dgvGWorkParas.Rows[16].Cells[1].Value = "限制";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, new int[]
						{
							17,
							18
						}, true);
					}
				}
				if (this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString() != null && this.dgvGWorkParas.Rows[20].Cells[1].ColumnIndex == 1)
				{
					this.dgvGWorkParas.Rows[20].Cells[1].Tag = this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString();
					if (this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString() == "0")
					{
						this.dgvGWorkParas.Rows[20].Cells[1].Value = "自动确定";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 21, false);
					}
					else if (this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString() == "1")
					{
						this.dgvGWorkParas.Rows[20].Cells[1].Value = "手动指定";
						this.SetDataGridvViewRowsVisiable(this.dgvGWorkParas, 21, true);
					}
				}
				for (int i = 0; i < this.dgvGWorkParas.Rows.Count; i++)
				{
					this.dgvGWorkParas.Rows[i].Cells[0].ReadOnly = true;
					if (i == 7 || i == 10 || i == 16 || i == 20)
					{
						this.dgvGWorkParas.Rows[i].Cells[1].ReadOnly = true;
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void btnGAuto_Click(object sender, EventArgs e)
		{
			this.GetPumpGroupSelData();
			if (this.groupPumpSel.AutoSelPump(this.m_allPumps))
			{
				if (this.rbGPumpsB.Checked)
				{
					this.tnGAutob.Nodes.Clear();
				}
				else
				{
					this.tnGAutoc.Nodes.Clear();
				}
				if (this.groupPumpSel.m_vecGroupPumpData.Count == 0)
				{
					this.groupPumpsResult.Rows.Clear();
					YJKMessageBox.Information("没有符合条件的泵组！！");
					return;
				}
				foreach (HYGroupPumpData hygroupPumpData in this.groupPumpSel.m_vecGroupPumpData)
				{
					TreeNode treeNode = new TreeNode(hygroupPumpData.m_strGroupName);
					treeNode.Tag = hygroupPumpData;
					if (this.rbGPumpsB.Checked)
					{
						this.tnGAutob.Nodes.Add(treeNode);
					}
					else
					{
						this.tnGAutoc.Nodes.Add(treeNode);
					}
					this.tvPumpGroupsResult.SelectedNode = treeNode;
				}
				YJKMessageBox.Information("泵组自动选型成功!");
			}
		}

		private void btnGMan_Click(object sender, EventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode == null)
			{
				return;
			}
			if (selectedNode.Tag is HYGroupPumpData)
			{
				if (selectedNode.Parent.Parent.Text.Contains("自动"))
				{
					return;
				}
				FormPumpProduct formPumpProduct = new FormPumpProduct("泵组选型");
				formPumpProduct.ShowDialog();
				(selectedNode.Tag as HYGroupPumpData).m_arrData.AddRange(formPumpProduct.m_arrSelPumps);
				using (List<HYPumpData>.Enumerator enumerator = formPumpProduct.m_arrSelPumps.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						HYPumpData hypumpData = enumerator.Current;
						object[] values = new object[]
						{
							hypumpData.StrSpecification,
							hypumpData.StrBaseType,
							hypumpData.StrStructType,
							hypumpData.StrFitType,
							hypumpData.DQ,
							hypumpData.DH,
							hypumpData.DEffection,
							hypumpData.DPumpPower,
							hypumpData.StrUse
						};
						this.groupPumpsResult.Rows.Add(values);
					}
					return;
				}
			}
			YJKMessageBox.Information("请选中正确水泵组！");
		}

		private void btnGDel_Click(object sender, EventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag is HYGroupPumpData)
			{
				object tag = selectedNode.Tag;
				if (YJKMessageBox.Show("是否确定要删除该泵组？", MessageBoxButtons.OKCancel) == DialogResult.OK)
				{
					this.tvPumpGroupsResult.Nodes.Remove(selectedNode);
				}
			}
		}

		private void btnGPDel_Click(object sender, EventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag is HYGroupPumpData)
			{
				if (this.groupPumpsResult.SelectedRows.Count == 0)
				{
					return;
				}
				if (YJKMessageBox.Show("是否确定要删除该水泵？", MessageBoxButtons.OKCancel) == DialogResult.OK)
				{
					HYPumpData hypumpBySPEC = this.GetHYpumpBySPEC(this.groupPumpsResult.SelectedRows[0].Cells[0].Value.ToString());
					(selectedNode.Tag as HYGroupPumpData).m_arrData.Remove(hypumpBySPEC);
					this.groupPumpsResult.Rows.RemoveAt(this.groupPumpsResult.SelectedRows[0].Index);
				}
			}
		}

		private void btngReName_Click(object sender, EventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag is HYGroupPumpData)
			{
				HYGroupPumpData hygroupPumpData = selectedNode.Tag as HYGroupPumpData;
				FormReName formReName = new FormReName(hygroupPumpData.m_strGroupName);
				if (formReName.ShowDialog() == DialogResult.OK)
				{
					hygroupPumpData.SetGroupName(formReName.m_sName);
					selectedNode.Text = formReName.m_sName;
					selectedNode.Tag = hygroupPumpData;
				}
			}
		}

		private void btnGSel_Click(object sender, EventArgs e)
		{
			if (this.tvPumpGroupsResult.SelectedNode == null)
			{
				return;
			}
			if (this.m_arrGroupPumpsList == null)
			{
				this.m_arrGroupPumpsList = new List<HYGroupPumpData>();
			}
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag is HYGroupPumpData)
			{
				HYGroupPumpData hygroupPumpData = new HYGroupPumpData(selectedNode.Tag as HYGroupPumpData);
				foreach (HYGroupPumpData hygroupPumpData2 in this.m_arrGroupPumpsList)
				{
					if (hygroupPumpData.IsSameTo(hygroupPumpData2))
					{
						if (YJKMessageBox.Show(string.Format("清单中泵组：{0}与当前选中的泵组选型一致，是否添加？", hygroupPumpData2.GetGroupName()), MessageBoxButtons.YesNo) == DialogResult.Yes)
						{
							this.m_arrGroupPumpsList.Add(hygroupPumpData);
							YJKMessageBox.Information("加入清单成功！");
							this.m_bPumpListChange = true;
						}
						return;
					}
				}
				this.m_arrGroupPumpsList.Add(hygroupPumpData);
				YJKMessageBox.Information("加入清单成功！");
				this.m_bPumpListChange = true;
			}
		}

		private void tvResultPumps_BeforeSelect(object sender, TreeViewCancelEventArgs e)
		{
			if (this.tvResultPumps.SelectedNode != null)
			{
				this.tvResultPumps.SelectedNode.BackColor = Color.White;
				this.tvResultPumps.SelectedNode.ForeColor = Color.Black;
			}
		}

		private void tvPumpGroupsResult_AfterSelect(object sender, TreeViewEventArgs e)
		{
			this.tvPumpGroupsResult.SelectedNode.BackColor = Color.DodgerBlue;
			this.tvPumpGroupsResult.SelectedNode.ForeColor = Color.White;
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag.ToString() == "Man" || (selectedNode.Parent != null && selectedNode.Parent.Tag.ToString() == "Man"))
			{
				this.btnGNew.Enabled = true;
			}
			else
			{
				this.btnGNew.Enabled = false;
			}
			if (selectedNode.Tag is HYGroupPumpData)
			{
				this.tvPumpGroupsResult.LabelEdit = true;
				this.groupPumpsResult.Rows.Clear();
				foreach (HYPumpData hypumpData in (selectedNode.Tag as HYGroupPumpData).m_arrData)
				{
					object[] values = new object[]
					{
						hypumpData.StrSpecification,
						hypumpData.StrBaseType,
						hypumpData.StrStructType,
						hypumpData.StrFitType,
						hypumpData.DQ,
						hypumpData.DH,
						hypumpData.DEffection,
						hypumpData.DPumpPower,
						hypumpData.StrUse
					};
					this.groupPumpsResult.Rows.Add(values);
				}
				this.groupPumpsResult.ClearSelection();
				this.btngReName.Enabled = true;
				return;
			}
			this.tvPumpGroupsResult.LabelEdit = false;
			this.btngReName.Enabled = false;
		}

		private void tvPumpGroupsResult_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			if (selectedNode.Tag is HYGroupPumpData)
			{
				HYGroupPumpData hygroupPumpData = selectedNode.Tag as HYGroupPumpData;
				hygroupPumpData.SetGroupName(e.Label);
				selectedNode.Tag = hygroupPumpData;
			}
		}

		private void GetPumpGroupSelData()
		{
			this.groupPumpSel.m_bIsParrel = this.rbGPumpsB.Checked;
			List<bool> list = new List<bool>();
			list.Add(this.chbGFactory.Checked);
			list.Add(this.chbGPumpType.Checked);
			list.Add(this.chbGStructType.Checked);
			list.Add(this.chbGInstallType.Checked);
			list.Add(this.chbGLunZhouPos.Checked);
			list.Add(this.chbGUse.Checked);
			list.Add(this.chbGResistCorrede.Checked);
			list.Add(this.chbGPerfectSeal.Checked);
			list.Add(this.chbGSelfDraw.Checked);
			this.groupPumpSel.SetSelItemBools(list);
			List<string> list2 = new List<string>();
			list2.Add(this.cmbGFactory.SelectedItem.ToString());
			list2.Add(this.cmbGPumpType.SelectedItem.ToString());
			list2.Add(this.cmbGStructType.SelectedItem.ToString());
			list2.Add(this.cmbGInstallType.SelectedItem.ToString());
			list2.Add(this.cmbGLunZhouPos.SelectedItem.ToString());
			list2.Add(this.cmbGUse.SelectedItem.ToString());
			this.groupPumpSel.SetLimitSelText(list2);
			this.groupPumpSel.m_bRangeMatch = this.rbGRangeMatch.Checked;
			if (this.rbSRangeMatch.Checked)
			{
				this.groupPumpSel.m_dQNeeded = double.Parse(this.ChangePumpQUnionty(ref this.dGQMin, this.hytbGPumpQ.Text, int.Parse(this.hytbGPumpQ.Tag.ToString()), 0));
				this.groupPumpSel.m_dQNeeded_Max = double.Parse(this.ChangePumpQUnionty(ref this.dGQMax, this.hytbGPumpMaxQ.Text, int.Parse(this.hytbGPumpMaxQ.Tag.ToString()), 0));
				this.groupPumpSel.m_dHNeeded = double.Parse(this.ChangePumpHUnionty(ref this.dGHMin, this.hytbGPumpH.Text, int.Parse(this.hytbGPumpH.Tag.ToString()), 0));
				this.groupPumpSel.m_dHNeeded_Max = double.Parse(this.ChangePumpHUnionty(ref this.dGHMax, this.hytbGPumpMaxH.Text, int.Parse(this.hytbGPumpMaxH.Tag.ToString()), 0));
				this.groupPumpSel.m_dEfficiencyNeeded = double.Parse(this.hytbGPumpE.Text.Trim());
				this.groupPumpSel.m_dEfficiency_Max = double.Parse(this.hytbGPumpMaxE.Text.Trim());
			}
			else
			{
				this.groupPumpSel.m_dQNeeded = double.Parse(this.ChangePumpQUnionty(ref this.dGQMin, this.hytbGPumpQ.Text, int.Parse(this.hytbGPumpQ.Tag.ToString()), 0));
				this.groupPumpSel.m_dHNeeded = double.Parse(this.ChangePumpHUnionty(ref this.dGHMin, this.hytbGPumpH.Text, int.Parse(this.hytbGPumpH.Tag.ToString()), 0));
				this.groupPumpSel.m_dEfficiencyNeeded = double.Parse(this.hytbGPumpE.Text.Trim());
				this.groupPumpSel.m_dHTolerance = double.Parse(this.dgvGWorkParas.Rows[1].Cells[1].Value.ToString()) / 100.0;
				this.groupPumpSel.m_dQTolerance = double.Parse(this.dgvGWorkParas.Rows[2].Cells[1].Value.ToString()) / 100.0;
				this.groupPumpSel.m_dETolerance = double.Parse(this.dgvGWorkParas.Rows[3].Cells[1].Value.ToString()) / 100.0;
			}
			bool flag = !this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString().Contains("不");
			list.Add(flag);
			this.groupPumpSel.m_bIsDrawAbility = flag;
			this.groupPumpSel.m_dTemperature = double.Parse(this.dgvGWorkParas.Rows[6].Cells[1].Value.ToString());
			string a = this.dgvGWorkParas.Rows[7].Cells[1].Value.ToString();
			if (!(a == "开式"))
			{
				if (a == "闭式")
				{
					this.groupPumpSel.m_bPipeOpen = false;
					this.groupPumpSel.m_dConstPressue = double.Parse(this.dgvGWorkParas.Rows[11].Cells[1].Value.ToString());
				}
			}
			else
			{
				this.groupPumpSel.m_bPipeOpen = true;
				this.groupPumpSel.m_dAirPressure = double.Parse(this.dgvGWorkParas.Rows[11].Cells[1].Value.ToString());
			}
			this.groupPumpSel.m_dDrawPipeLose = double.Parse(this.dgvGWorkParas.Rows[12].Cells[1].Value.ToString());
			this.groupPumpSel.m_dFitHeight = double.Parse(this.dgvGWorkParas.Rows[13].Cells[1].Value.ToString());
			this.groupPumpSel.m_dDrawSafeCofficient = double.Parse(this.dgvGWorkParas.Rows[14].Cells[1].Value.ToString());
			list.Add(true);
			this.groupPumpSel.m_dMaxPressure = double.Parse(this.dgvGWorkParas.Rows[15].Cells[1].Value.ToString());
			bool flag2 = !this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString().Contains("不");
			this.groupPumpSel.m_bTemp = flag2;
			list.Add(flag2);
			list.Add(flag2);
			this.groupPumpSel.m_dMaxTemp = double.Parse(this.dgvGWorkParas.Rows[17].Cells[1].Value.ToString());
			this.groupPumpSel.m_dMinTemp = double.Parse(this.dgvGWorkParas.Rows[18].Cells[1].Value.ToString());
			this.groupPumpSel.m_strFlowtype = this.dgvGWorkParas.Rows[5].Cells[1].Value.ToString();
			list.Add(false);
			this.groupPumpSel.SetLimitItemSel(list);
			bool bUserDefineNumber = !this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString().Contains("自动");
			this.groupPumpSel.m_bUserDefineNumber = bUserDefineNumber;
			this.groupPumpSel.m_nUserDefineNumber = (int)short.Parse(this.dgvGWorkParas.Rows[21].Cells[1].Value.ToString());
		}

		private void btnGNew_Click(object sender, EventArgs e)
		{
			TreeNode selectedNode = this.tvPumpGroupsResult.SelectedNode;
			int num;
			if (selectedNode.Text == "并联" || (selectedNode.Parent != null && selectedNode.Parent.Text == "并联"))
			{
				HYGroupPumpData hygroupPumpData = new HYGroupPumpData();
				hygroupPumpData.m_bIsParallel = true;
				HYGroupPumpData hygroupPumpData2 = hygroupPumpData;
				object arg = "手动并联方案";
				num = this.ngroupB;
				this.ngroupB = num + 1;
				hygroupPumpData2.m_strGroupName = (string)arg + num;
				TreeNode treeNode = new TreeNode(hygroupPumpData.m_strGroupName);
				treeNode.Tag = hygroupPumpData;
				this.tnGManb.Nodes.Add(treeNode);
				this.tnGManb.Expand();
				this.tvPumpGroupsResult.SelectedNode = treeNode;
				return;
			}
			HYGroupPumpData hygroupPumpData3 = new HYGroupPumpData();
			hygroupPumpData3.m_bIsParallel = false;
			HYGroupPumpData hygroupPumpData4 = hygroupPumpData3;
			object arg2 = "手动串联方案";
			num = this.ngroupC;
			this.ngroupC = num + 1;
			hygroupPumpData4.m_strGroupName = (string)arg2 + num;
			TreeNode treeNode2 = new TreeNode(hygroupPumpData3.m_strGroupName);
			treeNode2.Tag = hygroupPumpData3;
			this.tnGMnac.Nodes.Add(treeNode2);
			this.tnGMnac.Expand();
			this.tvPumpGroupsResult.SelectedNode = treeNode2;
		}

		private void cmbgpump_SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				if (sender is ComboBox)
				{
					ComboBox comboBox = sender as ComboBox;
					string name = comboBox.Name;
					if (!(name == "cmbgPumpH"))
					{
						if (name == "cmbgpumpQ")
						{
							this.hytbGPumpQ.Text = this.ChangePumpQUnionty(ref this.dGQMin, this.hytbGPumpQ.Text, int.Parse(this.hytbGPumpQ.Tag.ToString()), comboBox.SelectedIndex);
							this.hytbGPumpMaxQ.Text = this.ChangePumpQUnionty(ref this.dGQMax, this.hytbGPumpMaxQ.Text, int.Parse(this.hytbGPumpMaxQ.Tag.ToString()), comboBox.SelectedIndex);
							this.hytbGPumpQ.Tag = comboBox.SelectedIndex;
							this.hytbGPumpMaxQ.Tag = comboBox.SelectedIndex;
						}
					}
					else
					{
						this.hytbGPumpH.Text = this.ChangePumpHUnionty(ref this.dGHMin, this.hytbGPumpH.Text, int.Parse(this.hytbGPumpH.Tag.ToString()), comboBox.SelectedIndex);
						this.hytbGPumpMaxH.Text = this.ChangePumpHUnionty(ref this.dGHMax, this.hytbGPumpMaxH.Text, int.Parse(this.hytbGPumpMaxH.Tag.ToString()), comboBox.SelectedIndex);
						this.hytbGPumpH.Tag = comboBox.SelectedIndex;
						this.hytbGPumpMaxH.Tag = comboBox.SelectedIndex;
					}
				}
			}
			catch (Exception ex)
			{
				YJKMessageBox.Information(ex.Message);
			}
		}

		private void FormPumpSel_FormClosing(object sender, FormClosingEventArgs e)
		{
			this.btnClose_Click(null, null);
		}

		private void UpDateUIData()
		{
			this.ReadUserData();
			this.chbSFactory.Checked = this.singlePumpSelectionData.BFactory;
			this.chbSPumpType.Checked = this.singlePumpSelectionData.BPumpType;
			this.chbSInstallType.Checked = this.singlePumpSelectionData.BInstallType;
			this.chbSStructType.Checked = this.singlePumpSelectionData.BStructType;
			this.chbSLunzhouPos.Checked = this.singlePumpSelectionData.BLunzhouPos;
			this.chbSUse.Checked = this.singlePumpSelectionData.BUse;
			this.chbSResistCorrede.Checked = this.singlePumpSelectionData.BResistCorrede;
			this.chbSPerfectSeal.Checked = this.singlePumpSelectionData.BPerfectSeal;
			this.chbSSelfDraw.Checked = this.singlePumpSelectionData.BSelfDraw;
			this.cmbSFactory.SelectedItem = this.singlePumpSelectionData.StrFactory;
			this.cmbSPumpType.SelectedItem = this.singlePumpSelectionData.StrPumpType;
			this.cmbSInstallType.SelectedItem = this.singlePumpSelectionData.StrInstallType;
			this.cmbSStructType.SelectedItem = this.singlePumpSelectionData.StrStructType;
			this.cmbSLunzhouPos.SelectedItem = this.singlePumpSelectionData.StrLunzhouPos;
			this.cmbSUse.SelectedItem = this.singlePumpSelectionData.StrUse;
			this.rbSRangeMatch.Checked = this.singlePumpSelectionData.BRangeMatch;
			this.rbSPiancha.Checked = !this.singlePumpSelectionData.BRangeMatch;
			this.hyTbSPumpQ.Text = this.singlePumpSelectionData.DQmin.ToString();
			this.hyTbSPumpMaxQ.Text = this.singlePumpSelectionData.DQmax.ToString();
			this.hyTbSPumpH.Text = this.singlePumpSelectionData.DHmin.ToString();
			this.hyTbSPumpMaxH.Text = this.singlePumpSelectionData.DHmax.ToString();
			this.hyTbSPumpE.Text = this.singlePumpSelectionData.DEmin.ToString();
			this.hyTbSPumpMaxE.Text = this.singlePumpSelectionData.DEmax.ToString();
			this.cmbpumpHunity.SelectedItem = this.singlePumpSelectionData.StrPumpHunity;
			this.cmbpumpQunity.SelectedItem = this.singlePumpSelectionData.StrPumpQunity;
			this.dgvSWorkParas.Rows[1].Cells[1].Value = this.singlePumpSelectionData.DHTolerance;
			this.dgvSWorkParas.Rows[2].Cells[1].Value = this.singlePumpSelectionData.DQTolerance;
			this.dgvSWorkParas.Rows[3].Cells[1].Value = this.singlePumpSelectionData.DETolerance;
			this.dgvSWorkParas.Rows[5].Cells[1].Value = this.singlePumpSelectionData.StrFlowtype;
			this.dgvSWorkParas.Rows[6].Cells[1].Value = this.singlePumpSelectionData.DTemperature;
			this.dgvSWorkParas.Rows[8].Cells[1].Value = this.singlePumpSelectionData.DHydrostatic;
			this.dgvSWorkParas.Rows[11].Cells[1].Value = this.singlePumpSelectionData.DAirPressure;
			this.dgvSWorkParas.Rows[12].Cells[1].Value = this.singlePumpSelectionData.DDrawPipeLose;
			this.dgvSWorkParas.Rows[13].Cells[1].Value = this.singlePumpSelectionData.DFitHeight;
			this.dgvSWorkParas.Rows[14].Cells[1].Value = this.singlePumpSelectionData.DDrawSafeCofficient;
			this.dgvSWorkParas.Rows[15].Cells[1].Value = this.singlePumpSelectionData.DMaxPressure;
			this.dgvSWorkParas.Rows[17].Cells[1].Value = this.singlePumpSelectionData.DMaxTemp;
			this.dgvSWorkParas.Rows[18].Cells[1].Value = this.singlePumpSelectionData.DMinTemp;
			if (this.singlePumpSelectionData.BPipeOpen)
			{
				this.dgvSWorkParas.Rows[7].Cells[1].Value = "开式";
			}
			else
			{
				this.dgvSWorkParas.Rows[7].Cells[1].Value = "闭式";
			}
			if (this.singlePumpSelectionData.BIsDrawAbility)
			{
				this.dgvSWorkParas.Rows[10].Cells[1].Value = "不校核";
			}
			else
			{
				this.dgvSWorkParas.Rows[10].Cells[1].Value = "校核";
			}
			if (this.singlePumpSelectionData.BTestTemp)
			{
				this.dgvSWorkParas.Rows[16].Cells[1].Value = "限制";
			}
			else
			{
				this.dgvSWorkParas.Rows[16].Cells[1].Value = "不限制";
			}
			this.SetDataGridvViewRowsVisiable(this.dgvSWorkParas, 5, false);
			this.chbGFactory.Checked = this.groupPumpSelectionData.BFactory;
			this.chbGPumpType.Checked = this.groupPumpSelectionData.BPumpType;
			this.chbGInstallType.Checked = this.groupPumpSelectionData.BInstallType;
			this.chbGStructType.Checked = this.groupPumpSelectionData.BStructType;
			this.chbGLunZhouPos.Checked = this.groupPumpSelectionData.BLunzhouPos;
			this.chbGUse.Checked = this.groupPumpSelectionData.BUse;
			this.chbGResistCorrede.Checked = this.groupPumpSelectionData.BResistCorrede;
			this.chbGPerfectSeal.Checked = this.groupPumpSelectionData.BPerfectSeal;
			this.chbGSelfDraw.Checked = this.groupPumpSelectionData.BSelfDraw;
			this.cmbGFactory.SelectedItem = this.groupPumpSelectionData.StrFactory;
			this.cmbGPumpType.SelectedItem = this.groupPumpSelectionData.StrPumpType;
			this.cmbGInstallType.SelectedItem = this.groupPumpSelectionData.StrInstallType;
			this.cmbGStructType.SelectedItem = this.groupPumpSelectionData.StrStructType;
			this.cmbGLunZhouPos.SelectedItem = this.groupPumpSelectionData.StrLunzhouPos;
			this.cmbGUse.SelectedItem = this.groupPumpSelectionData.StrUse;
			this.rbGPumpsB.Checked = this.groupPumpSelectionData.BIsParallel;
			this.rbGPumpsC.Checked = !this.groupPumpSelectionData.BIsParallel;
			this.rbGRangeMatch.Checked = this.groupPumpSelectionData.BRangeMatch;
			this.rbGPiancha.Checked = !this.groupPumpSelectionData.BRangeMatch;
			this.hytbGPumpQ.Text = this.groupPumpSelectionData.DQmin.ToString();
			this.hytbGPumpMaxQ.Text = this.groupPumpSelectionData.DQmax.ToString();
			this.hytbGPumpH.Text = this.groupPumpSelectionData.DHmin.ToString();
			this.hytbGPumpMaxH.Text = this.groupPumpSelectionData.DHmax.ToString();
			this.hytbGPumpE.Text = this.groupPumpSelectionData.DEmin.ToString();
			this.hytbGPumpMaxE.Text = this.groupPumpSelectionData.DEmax.ToString();
			this.cmbgPumpH.SelectedItem = this.groupPumpSelectionData.StrPumpHunity;
			this.cmbgpumpQ.SelectedItem = this.groupPumpSelectionData.StrPumpQunity;
			this.dgvGWorkParas.Rows[1].Cells[1].Value = this.groupPumpSelectionData.DHTolerance;
			this.dgvGWorkParas.Rows[2].Cells[1].Value = this.groupPumpSelectionData.DQTolerance;
			this.dgvGWorkParas.Rows[3].Cells[1].Value = this.groupPumpSelectionData.DETolerance;
			this.dgvGWorkParas.Rows[5].Cells[1].Value = this.groupPumpSelectionData.StrFlowtype;
			this.dgvGWorkParas.Rows[6].Cells[1].Value = this.groupPumpSelectionData.DTemperature;
			this.dgvGWorkParas.Rows[8].Cells[1].Value = this.groupPumpSelectionData.DHydrostatic;
			this.dgvGWorkParas.Rows[11].Cells[1].Value = this.groupPumpSelectionData.DAirPressure;
			this.dgvGWorkParas.Rows[12].Cells[1].Value = this.groupPumpSelectionData.DDrawPipeLose;
			this.dgvGWorkParas.Rows[13].Cells[1].Value = this.groupPumpSelectionData.DFitHeight;
			this.dgvGWorkParas.Rows[14].Cells[1].Value = this.groupPumpSelectionData.DDrawSafeCofficient;
			this.dgvGWorkParas.Rows[15].Cells[1].Value = this.groupPumpSelectionData.DMaxPressure;
			this.dgvGWorkParas.Rows[17].Cells[1].Value = this.groupPumpSelectionData.DMaxTemp;
			this.dgvGWorkParas.Rows[18].Cells[1].Value = this.groupPumpSelectionData.DMinTemp;
			this.dgvGWorkParas.Rows[21].Cells[1].Value = this.groupPumpSelectionData.NPumpNum;
			if (this.groupPumpSelectionData.BPipeOpen)
			{
				this.dgvGWorkParas.Rows[7].Cells[1].Value = "开式";
			}
			else
			{
				this.dgvGWorkParas.Rows[7].Cells[1].Value = "闭式";
			}
			if (this.groupPumpSelectionData.BIsDrawAbility)
			{
				this.dgvGWorkParas.Rows[10].Cells[1].Value = "不校核";
			}
			else
			{
				this.dgvGWorkParas.Rows[10].Cells[1].Value = "校核";
			}
			if (this.groupPumpSelectionData.BTestTemp)
			{
				this.dgvGWorkParas.Rows[16].Cells[1].Value = "限制";
			}
			else
			{
				this.dgvGWorkParas.Rows[16].Cells[1].Value = "不限制";
			}
			if (this.groupPumpSelectionData.BManPumpNum)
			{
				this.dgvGWorkParas.Rows[20].Cells[1].Value = "手动指定";
				return;
			}
			this.dgvGWorkParas.Rows[20].Cells[1].Value = "自动确定";
		}

		private void ReadUserData()
		{
			Dictionary<string, string> dictionary = this.userSetting.GetSinglePumpSelectionData();
			foreach (PropertyInfo propertyInfo in this.singlePumpSelectionData.GetType().GetProperties())
			{
				if (!(dictionary[propertyInfo.Name] == ""))
				{
					if (propertyInfo.Name.StartsWith("B"))
					{
						propertyInfo.SetValue(this.singlePumpSelectionData, bool.Parse(dictionary[propertyInfo.Name]));
					}
					else if (propertyInfo.Name.StartsWith("D"))
					{
						propertyInfo.SetValue(this.singlePumpSelectionData, double.Parse(dictionary[propertyInfo.Name]));
					}
					else if (propertyInfo.Name.StartsWith("S"))
					{
						propertyInfo.SetValue(this.singlePumpSelectionData, dictionary[propertyInfo.Name]);
					}
				}
			}
			Dictionary<string, string> dictionary2 = this.userSetting.GetGroupPumpSelectionData();
			foreach (PropertyInfo propertyInfo2 in this.groupPumpSelectionData.GetType().GetProperties())
			{
				if (!(dictionary2[propertyInfo2.Name] == ""))
				{
					if (propertyInfo2.Name.StartsWith("B"))
					{
						propertyInfo2.SetValue(this.groupPumpSelectionData, bool.Parse(dictionary2[propertyInfo2.Name]));
					}
					else if (propertyInfo2.Name.StartsWith("D"))
					{
						propertyInfo2.SetValue(this.groupPumpSelectionData, double.Parse(dictionary2[propertyInfo2.Name]));
					}
					else if (propertyInfo2.Name.StartsWith("S"))
					{
						propertyInfo2.SetValue(this.groupPumpSelectionData, dictionary2[propertyInfo2.Name]);
					}
					else if (propertyInfo2.Name.StartsWith("N"))
					{
						propertyInfo2.SetValue(this.groupPumpSelectionData, int.Parse(dictionary2[propertyInfo2.Name]));
					}
				}
			}
		}

		private void ReadSinglePumpData()
		{
			this.singlePumpSelectionData.BFactory = this.chbSFactory.Checked;
			this.singlePumpSelectionData.BPumpType = this.chbSPumpType.Checked;
			this.singlePumpSelectionData.BInstallType = this.chbSInstallType.Checked;
			this.singlePumpSelectionData.BStructType = this.chbSStructType.Checked;
			this.singlePumpSelectionData.BLunzhouPos = this.chbSLunzhouPos.Checked;
			this.singlePumpSelectionData.BUse = this.chbSUse.Checked;
			this.singlePumpSelectionData.BResistCorrede = this.chbSResistCorrede.Checked;
			this.singlePumpSelectionData.BPerfectSeal = this.chbSPerfectSeal.Checked;
			this.singlePumpSelectionData.BSelfDraw = this.chbSSelfDraw.Checked;
			this.singlePumpSelectionData.StrFactory = this.cmbSFactory.SelectedItem.ToString();
			this.singlePumpSelectionData.StrPumpType = this.cmbSPumpType.SelectedItem.ToString();
			this.singlePumpSelectionData.StrInstallType = this.cmbSInstallType.SelectedItem.ToString();
			this.singlePumpSelectionData.StrStructType = this.cmbSStructType.SelectedItem.ToString();
			this.singlePumpSelectionData.StrLunzhouPos = this.cmbSLunzhouPos.SelectedItem.ToString();
			this.singlePumpSelectionData.StrUse = this.cmbSUse.SelectedItem.ToString();
			this.singlePumpSelectionData.BRangeMatch = this.rbSRangeMatch.Checked;
			this.singlePumpSelectionData.DQmin = double.Parse(this.ChangePumpQUnionty(ref this.dSQMin, this.hyTbSPumpQ.Text, int.Parse(this.hyTbSPumpQ.Tag.ToString()), 0));
			this.singlePumpSelectionData.DQmax = double.Parse(this.ChangePumpQUnionty(ref this.dSQMax, this.hyTbSPumpMaxQ.Text, int.Parse(this.hyTbSPumpMaxQ.Tag.ToString()), 0));
			this.singlePumpSelectionData.DHmin = double.Parse(this.ChangePumpHUnionty(ref this.dSHMin, this.hyTbSPumpH.Text, int.Parse(this.hyTbSPumpH.Tag.ToString()), 0));
			this.singlePumpSelectionData.DHmax = double.Parse(this.ChangePumpHUnionty(ref this.dSHMax, this.hyTbSPumpMaxH.Text, int.Parse(this.hyTbSPumpMaxH.Tag.ToString()), 0));
			this.singlePumpSelectionData.DEmin = double.Parse(this.hyTbSPumpE.Text.Trim());
			this.singlePumpSelectionData.DEmax = double.Parse(this.hyTbSPumpMaxE.Text.Trim());
			this.singlePumpSelectionData.DHTolerance = double.Parse(this.dgvSWorkParas.Rows[1].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DQTolerance = double.Parse(this.dgvSWorkParas.Rows[2].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DETolerance = double.Parse(this.dgvSWorkParas.Rows[3].Cells[1].Value.ToString());
			this.singlePumpSelectionData.BIsDrawAbility = !this.dgvSWorkParas.Rows[10].Cells[1].Value.ToString().Contains("不");
			this.singlePumpSelectionData.DTemperature = double.Parse(this.dgvSWorkParas.Rows[6].Cells[1].Value.ToString());
			this.singlePumpSelectionData.BPipeOpen = this.dgvSWorkParas.Rows[7].Cells[1].Value.ToString().Contains("开式");
			this.singlePumpSelectionData.DAirPressure = double.Parse(this.dgvSWorkParas.Rows[11].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DDrawPipeLose = double.Parse(this.dgvSWorkParas.Rows[12].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DFitHeight = double.Parse(this.dgvSWorkParas.Rows[13].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DDrawSafeCofficient = double.Parse(this.dgvSWorkParas.Rows[14].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DMaxPressure = double.Parse(this.dgvSWorkParas.Rows[15].Cells[1].Value.ToString());
			this.singlePumpSelectionData.BTestTemp = !this.dgvSWorkParas.Rows[16].Cells[1].Value.ToString().Contains("不");
			this.singlePumpSelectionData.DMaxTemp = double.Parse(this.dgvSWorkParas.Rows[17].Cells[1].Value.ToString());
			this.singlePumpSelectionData.DMinTemp = double.Parse(this.dgvSWorkParas.Rows[18].Cells[1].Value.ToString());
			this.singlePumpSelectionData.StrFlowtype = this.dgvSWorkParas.Rows[5].Cells[1].Value.ToString();
			this.singlePumpSelectionData.DHydrostatic = double.Parse(this.dgvSWorkParas.Rows[8].Cells[1].Value.ToString());
			this.singlePumpSelectionData.StrPumpHunity = this.cmbpumpHunity.SelectedItem.ToString();
			this.singlePumpSelectionData.StrPumpQunity = this.cmbpumpQunity.SelectedItem.ToString();
		}

		private void ReadGroupPumpData()
		{
			this.groupPumpSelectionData.BIsParallel = this.rbGPumpsB.Checked;
			this.groupPumpSelectionData.BFactory = this.chbGFactory.Checked;
			this.groupPumpSelectionData.BPumpType = this.chbGPumpType.Checked;
			this.groupPumpSelectionData.BInstallType = this.chbGInstallType.Checked;
			this.groupPumpSelectionData.BStructType = this.chbGStructType.Checked;
			this.groupPumpSelectionData.BLunzhouPos = this.chbGLunZhouPos.Checked;
			this.groupPumpSelectionData.BUse = this.chbGUse.Checked;
			this.groupPumpSelectionData.BResistCorrede = this.chbGResistCorrede.Checked;
			this.groupPumpSelectionData.BPerfectSeal = this.chbGPerfectSeal.Checked;
			this.groupPumpSelectionData.BSelfDraw = this.chbGSelfDraw.Checked;
			this.groupPumpSelectionData.StrFactory = this.cmbGFactory.SelectedItem.ToString();
			this.groupPumpSelectionData.StrPumpType = this.cmbGPumpType.SelectedItem.ToString();
			this.groupPumpSelectionData.StrInstallType = this.cmbGInstallType.SelectedItem.ToString();
			this.groupPumpSelectionData.StrStructType = this.cmbGStructType.SelectedItem.ToString();
			this.groupPumpSelectionData.StrLunzhouPos = this.cmbGLunZhouPos.SelectedItem.ToString();
			this.groupPumpSelectionData.StrUse = this.cmbGUse.SelectedItem.ToString();
			this.groupPumpSelectionData.BRangeMatch = this.rbGRangeMatch.Checked;
			this.groupPumpSelectionData.DQmin = double.Parse(this.ChangePumpQUnionty(ref this.dGQMin, this.hytbGPumpQ.Text, int.Parse(this.hytbGPumpQ.Tag.ToString()), 0));
			this.groupPumpSelectionData.DQmax = double.Parse(this.ChangePumpQUnionty(ref this.dGQMax, this.hytbGPumpMaxQ.Text, int.Parse(this.hytbGPumpMaxQ.Tag.ToString()), 0));
			this.groupPumpSelectionData.DHmin = double.Parse(this.ChangePumpHUnionty(ref this.dGHMin, this.hytbGPumpH.Text, int.Parse(this.hytbGPumpH.Tag.ToString()), 0));
			this.groupPumpSelectionData.DHmax = double.Parse(this.ChangePumpHUnionty(ref this.dGHMax, this.hytbGPumpMaxH.Text, int.Parse(this.hytbGPumpMaxH.Tag.ToString()), 0));
			this.groupPumpSelectionData.DEmin = double.Parse(this.hytbGPumpE.Text.Trim());
			this.groupPumpSelectionData.DEmax = double.Parse(this.hytbGPumpMaxE.Text.Trim());
			this.groupPumpSelectionData.DHTolerance = double.Parse(this.dgvGWorkParas.Rows[1].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DQTolerance = double.Parse(this.dgvGWorkParas.Rows[2].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DETolerance = double.Parse(this.dgvGWorkParas.Rows[3].Cells[1].Value.ToString());
			this.groupPumpSelectionData.BIsDrawAbility = !this.dgvGWorkParas.Rows[10].Cells[1].Value.ToString().Contains("不");
			this.groupPumpSelectionData.DTemperature = double.Parse(this.dgvGWorkParas.Rows[6].Cells[1].Value.ToString());
			this.groupPumpSelectionData.BPipeOpen = this.dgvGWorkParas.Rows[7].Cells[1].Value.ToString().Contains("开式");
			this.groupPumpSelectionData.DAirPressure = double.Parse(this.dgvGWorkParas.Rows[11].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DDrawPipeLose = double.Parse(this.dgvGWorkParas.Rows[12].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DFitHeight = double.Parse(this.dgvGWorkParas.Rows[13].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DDrawSafeCofficient = double.Parse(this.dgvGWorkParas.Rows[14].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DMaxPressure = double.Parse(this.dgvGWorkParas.Rows[15].Cells[1].Value.ToString());
			this.groupPumpSelectionData.BTestTemp = !this.dgvGWorkParas.Rows[16].Cells[1].Value.ToString().Contains("不");
			this.groupPumpSelectionData.DMaxTemp = double.Parse(this.dgvGWorkParas.Rows[17].Cells[1].Value.ToString());
			this.groupPumpSelectionData.DMinTemp = double.Parse(this.dgvGWorkParas.Rows[18].Cells[1].Value.ToString());
			this.groupPumpSelectionData.StrFlowtype = this.dgvGWorkParas.Rows[5].Cells[1].Value.ToString();
			this.groupPumpSelectionData.BManPumpNum = !this.dgvGWorkParas.Rows[20].Cells[1].Value.ToString().Contains("自动");
			this.groupPumpSelectionData.NPumpNum = (int)short.Parse(this.dgvGWorkParas.Rows[21].Cells[1].Value.ToString());
			this.groupPumpSelectionData.StrPumpHunity = this.cmbgPumpH.SelectedItem.ToString();
			this.groupPumpSelectionData.StrPumpQunity = this.cmbgpumpQ.SelectedItem.ToString();
		}

		private void SaveUserData()
		{
			this.ReadSinglePumpData();
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			foreach (PropertyInfo propertyInfo in this.singlePumpSelectionData.GetType().GetProperties())
			{
				dictionary.Add(propertyInfo.Name, propertyInfo.GetValue(this.singlePumpSelectionData).ToString());
			}
			this.userSetting.WriteUserData(dictionary, "singlePumpData");
			this.ReadGroupPumpData();
			Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
			foreach (PropertyInfo propertyInfo2 in this.groupPumpSelectionData.GetType().GetProperties())
			{
				dictionary2.Add(propertyInfo2.Name, propertyInfo2.GetValue(this.groupPumpSelectionData).ToString());
			}
			this.userSetting.WriteUserData(dictionary2, "groupPumpData");
		}

		private string[] strPumpFactorys = new string[]
		{
			"全部",
			"博山水泵",
			"大福水泵",
			"东泉泵业",
			"格兰富",
			"凯泉泵业",
			"连成泵业",
			"南方泵业",
			"山东双轮泵业",
			"上海第一泵业",
			"上海水泵厂",
			"沈阳水泵厂",
			"新界水泵",
			"熊猫水泵"
		};

		private string[] strPumpJGLeiLeiXing = new string[]
		{
			"全部",
			"离心式",
			"轴流式",
			"混流式"
		};

		private string[] strPumpLiXin = new string[]
		{
			"全部",
			"单级单吸",
			"单级双吸",
			"分段式多级",
			"中开式多级",
			"双壳式多级",
			"管道泵",
			"高速泵",
			"旋壳泵",
			"屏蔽泵",
			"磁力泵",
			"自吸泵"
		};

		private string[] strPumpZhouLiu = new string[]
		{
			"全部",
			"半调叶轮",
			"全调叶轮",
			"固定叶轮"
		};

		private string[] strPumpHunLiu = new string[]
		{
			"全部",
			"导叶式",
			"蜗壳式"
		};

		private string[] strPumpInstallType = new string[]
		{
			"全部",
			"立式",
			"卧式"
		};

		private string[] strPumpUse = new string[]
		{
			"全部",
			"通用清水泵",
			"高压清水泵",
			"高压热水泵",
			"排污泵"
		};

		private double dSHMax = 90.0;

		private double dSHMin = 80.0;

		private double dSQMax = 110.0;

		private double dSQMin = 100.0;

		private double dGHMax = 110.0;

		private double dGHMin = 100.0;

		private double dGQMax = 220.0;

		private double dGQMin = 200.0;

		private bool m_bPumpListChange;

		private List<HYPumpData> m_arrSinglePumpsList;

		private List<HYGroupPumpData> m_arrGroupPumpsList;

		private bool bInitGrig;

		private List<HYPumpData> m_allPumps;

		private SinglePumpSelection singlePumpSel;

		private GroupPumpSelection groupPumpSel;

		private HVACUserSetting userSetting = new HVACUserSetting();

		private HYGroupPumpData m_lCurGroupPump;

		private HYPumpData m_lCurPump;

		private bool m_blCurSelectedIsPump;

		private SinglePumpSelectionData singlePumpSelectionData = new SinglePumpSelectionData();

		private GroupPumpSelectionData groupPumpSelectionData = new GroupPumpSelectionData();

		private ComboBox cmb_sPipeOpen;

		private ComboBox cmb_sDrawAbility;

		private ComboBox cmb_sTempLimit;

		private ComboBox cmb_gPipeOpen;

		private ComboBox cmb_gDrawAbility;

		private ComboBox cmb_gTempLimit;

		private ComboBox cmb_gGroupNum;

		private DataGridViewGroupCell cellAuto;

		private DataGridViewGroupCell cellMan;

		private TreeNode tnGAutob;

		private TreeNode tnGAutoc;

		private TreeNode tnGManb;

		private TreeNode tnGMnac;

		private TreeNode tnListSingle;

		private TreeNode tnListGroup;

		private int ngroupB = 1;

		private int ngroupC = 1;
	}
}
